how to set ssl after changing vps for payara server? - java

I used self signed ssl on vps for payara (fork of glassfish)
then i duplicated the payara on another server then https on 2nd vps doesnt work
and i create new self signed ssl by this tutorial.
now https works on my application but i cant enable-secure-admin or open payara control panel
it gives me sslhandshake exception.

Related

tomcat to send SSL client certificate

I am trying to do a https rest API call with a SSL certificate(PFX file) which have a password. I tested the connection from my desktop with SOAP UI and it is working fine.
I have a web application which is running on tomcat and I need my tomcat to send this certificate for all the http/https call which it will make.
I am not a tomcat person so i am stuck with this now.
I can find in online about how to set up a keystore & server.xml so that my web app can use Client Authentication against things connecting to it, not for when it needs to connect out to some other server(outgoing call).
my tomcat version is : 9.0.22
connector settings on my server.xml file

Trying to get LetsEncrypt to run on GlassFish

I've been trying to install LetsEncrypt on my server. My server is running on GlassFish and I've been getting a whole bunch of challenge errors from all of the letsencrypt services, any help would be appreciated!
System Info:
CentOS 7
Webservice: GlassFish
Here are some images of the error codes:
The problem is not in your GlassFish configuration but because LetsEncrypt services are not able to find the letsencrypt file under the url displayed in the error (starting with https://mdjdreview.com/index.php/.well-known/acme-challenge/...).
This is because your GlassFish does not serve the file, but redirects the URL to EdgeMAX application, which just returns a 404 page - not found.
I recommend to follow the steps in the letsencrypt guide here: https://certbot.eff.org/#centosrhel7-other, and use the certonly option with --standalone. You would need to stop GlassFish (or a proxy server listening on port 80) for a while, as this option needs to run a standalone HTTP server and it would collide with GlassFish.
Letsencrypt requires your server to serve the letsencrypt file from the specified URL, and with your current configuration, it is not possible to do it with GlassFish.

Apache httpd ssl reverse proxy

I have the following scenario:
Web application (currently running in Eclipse)
Apache httpd proxy
5 backend servers (tomcat) all listening on HTTPS
I have valid certificates for all backend servers and also have the cert chain imported in the keystore. Can anyone explain to me or give me a sample config for the proxy? I am getting different errors when trying to establish trust between the proxy and backend servers like (downstream server wanted client certificate but none are configured).

Client Certificate using Weblogic

Background:
I am working on a project that involves the client to authenticate itself (via client certificate). We are trying to launch a third party app which first authenticates the client cert and then launches its app.
We are using Java and SSL hanshake, and our client server is Weblogic 10.x. The client certificate is in PKCS12 format (cannot change this)
This is the piece of code for presenting the certificate:
System.setProperty("javax.net.ssl.keyStore","MyPath/cert.pfx");
System.setProperty("javax.net.ssl.keyStorePassword","MyPwd");
System.setProperty("javax.net.ssl.keyStoreType","PKCS12");
url.openConnection();
Now all this works pretty well from a standalone. The problem starts when we put this on weblogic. Sometimes it works, sometimes 'Client certificate not present' (http 403.7) is returned. I have tried various combinations (including configuring custome keystore on weblogic console) but nothing seems to work. Any idea why would weblogic altogether ignore the SSL settings (it doesnt throw an error even if I set keystore to a non-existent file)? System.setProperty for SSL just appears useless on weblogic!
In Weblogic 12c you also need add the parameter -DUseSunHttpHandler=true in order to tell the weblogic server to use the Sun Http Handlers instead of its own. Therefore you need the following Java VM parameters:
-Djavax.net.ssl.keyStore=MyPath/cert.pfx
-Djavax.net.ssl.keyStoreType=PKCS12
-Djavax.net.ssl.keyStorePassword=MyPwd
-DUseSunHttpHandler=true
Finally found the solution! Weblogic seems to over-ride the keystore configurations if it is done through Java as above. The thing that worked for me was to configure the SSL settings on JVM level, at web-logic start-up.
To make it work, I just added these Java options in the start-script for weblogic:
-Djavax.net.ssl.keyStore=MyPath/cert.pfx
-Djavax.net.ssl.keyStoreType=MyPwd
-Djavax.net.ssl.keyStorePassword=PKCS12
Restarted web-logic and SSL has been working great since then :)

Client Web Service call over SSL using Apache Axis

I'm using Apache Axis 1.5.1 to code a web service client connecting to a service over SSL. My application is running in Tomcat with SSL configuration setup in JKS. However, when I connect to the server, the connection is failing because the cert from our client is not being sent to the server. Is this something that has to be set in the client through code? Also note that the server does not need any user name or password authentication. With SSL turned off, everything works fine.
Thanks,
Two common approaches here:
http://ws.apache.org/xmlrpc/ssl.html
WebLogic has its own stuff:
http://download.oracle.com/docs/cd/E12840_01/wls/docs103/security/SSL_client.html#wp1029670
As long as you have the certificates configured correctly in your trust store accessible to Tomcat, there are no changes to Apache Axis HTTP code.

Categories