Unable to remotly connect to SSL enabled application from Hawtio - ssl

I am not able to remotly connect to my springboot microservice from hawtio.
If i am disabling ssl then i am able to see camel routes in hawtio console.
hawtio console
Error in response:
Request URL: http://localhost:8090/hawtio/proxy/https/lxapptaldev003/4150/jolokia/
Request Method: POST
Status Code: 500 sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Add this JVM parameter:
-Dhawtio.proxyDisableCertificateValidation=true
Credit:
Google-Groups

Related

KarateUI: How to Handle SSL Certificate during geckodriver configuration? [duplicate]

I've connect mongoDb with SSL & Certs(Trust, Keystore) using Springboot
System.setProperty("javax.net.ssl.trustStore", trustStoreFilePath.getPath());
System.setProperty("javax.net.ssl.trustStorePassword", truststorePassword);
System.setProperty("javax.net.ssl.keyStore", keyStoreFilePath.getPath());
System.setProperty("javax.net.ssl.keyStorePassword", keystorePassword);
Then, able to connect successfully
Then, tried REST call on https://xxxxxx.net/api/v1/login
Added and tried below options
- karate.configure('ssl', true);
- * configure ssl = true
i'm getting below error -
admin_login.feature
21:43:28.106 [ForkJoinPool-1-worker-1] ERROR com.intuit.karate - javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target, http call failed after 943 milliseconds for URL: https://xxxxxx.net/api/v1/login
21:43:28.107 [ForkJoinPool-1-worker-1] ERROR com.intuit.karate - http request failed:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
21:43:28.114 [ForkJoinPool-1-worker-1] ERROR com.intuit.karate - feature call failed: classpath:admin_login.feature
arg: [object Object]
admin_login.feature:8 -
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
21:43:28.116 [ForkJoinPool-1-worker-1] ERROR com.intuit.karate - javascript function call failed:
admin_login.feature:8 -
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
if i'm not connecting db with ssl. able to call all REST calls
Please help on this.
SSL can be tricky, you may need time and patience.
Normally * configure ssl = true should just work in Karate because it will disable certificate validation. Sounds like here you have set some System properties that is being picked up by Karate also. Refer https://github.com/intuit/karate#system-properties-for-ssl-and-http-proxy
So maybe if you use the advanced form of configure ssl you can get it it work.
Remember if are still stuck and you need more support, follow the instructions here: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue

Javamail how to connect to IMAPs mail server, without certificate Validation

I'm trying to connect my Java application to a IMAP server mail on 993, in a test environment.
I'm trying to ignore the certificate validation ,using a recommendation from previous answers to a similar question, as follows:
imapProps.put("mail.imaps.ssl.checkserveridentity", "false");
imapProps.put("mail.imaps.ssl.trust", "*");
but it doesn't seem to work, I'am still getting an exception.
Cannot process current mailbox => sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
javax.mail.MessagingException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target;
nested exception is:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:727)
So my question is, is it actually possible to use IMAPS protocol to connect to a mail server,without having to check or validate the certificate ?
If it is, choosing to ignore the certificate validation wouldn't it be a 2 sides decision then? JavaApp and the mailServer ?
You need to use the same protocol name in both the properties and in the getStore method call. So, since you're setting the imaps properties, you should be using Store s = session.getStore("imaps");

I am getting getting SSL handshake issue How to disable ssl in karate

When I am trying to access a secure endpoint, I am getting SSL handshake exception even after I disable ssl by using the following karate ways.
option1) declared the following in feature file
* configure ssl = true
option2) declared the following in karate-config.js
karate.configure('ssl', { trustAll: true });
(or)
karate.configure('ssl', true);
Exception:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target.
Please help me out on this issue.
Maybe you missed to make the url start with https, or vice-versa.
If you still have issues, follow this process: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue

How to fix - `ERROR com.intuit.karate - http request failed`

I've connect mongoDb with SSL & Certs(Trust, Keystore) using Springboot
System.setProperty("javax.net.ssl.trustStore", trustStoreFilePath.getPath());
System.setProperty("javax.net.ssl.trustStorePassword", truststorePassword);
System.setProperty("javax.net.ssl.keyStore", keyStoreFilePath.getPath());
System.setProperty("javax.net.ssl.keyStorePassword", keystorePassword);
Then, able to connect successfully
Then, tried REST call on https://xxxxxx.net/api/v1/login
Added and tried below options
- karate.configure('ssl', true);
- * configure ssl = true
i'm getting below error -
admin_login.feature
21:43:28.106 [ForkJoinPool-1-worker-1] ERROR com.intuit.karate - javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target, http call failed after 943 milliseconds for URL: https://xxxxxx.net/api/v1/login
21:43:28.107 [ForkJoinPool-1-worker-1] ERROR com.intuit.karate - http request failed:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
21:43:28.114 [ForkJoinPool-1-worker-1] ERROR com.intuit.karate - feature call failed: classpath:admin_login.feature
arg: [object Object]
admin_login.feature:8 -
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
21:43:28.116 [ForkJoinPool-1-worker-1] ERROR com.intuit.karate - javascript function call failed:
admin_login.feature:8 -
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
if i'm not connecting db with ssl. able to call all REST calls
Please help on this.
SSL can be tricky, you may need time and patience.
Normally * configure ssl = true should just work in Karate because it will disable certificate validation. Sounds like here you have set some System properties that is being picked up by Karate also. Refer https://github.com/intuit/karate#system-properties-for-ssl-and-http-proxy
So maybe if you use the advanced form of configure ssl you can get it it work.
Remember if are still stuck and you need more support, follow the instructions here: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue

Glassfisch JavaMail session

I have this small ejb bean that sends emails, I use JavaMail Session on the Glassfish. On the settings of Admin Glassfish under Java Mail Session I use Google credentials to send/receive emails. With google account I can receive and send emails but when I try with personal email of my dedicated server for example my#dommainname.com then then the Glassfish is not sending/receiving any emails.
I have suspicion that I don't fill correct information on Glassfish under JavaMail Session. On the tab "Advanced" under JavaMail Session there are 4 fields required some information about my mail server:
Store Protocol: imap
Store Protocol Class:com.sun.mail.imap.IMAPStore
Transport Protocol: smtp
Transport Protocol Class:com.sun.mail.smtp.SMTPTransport
Why is it when I use google gmail account it works perfectly but is not sending any emails nor receiving when I use email of my own domainname? The application hangs with loading and I get this error:
type Exception report
messageInternal Server Error
descriptionThe server encountered an internal error that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Could not convert socket to TLS
root cause
javax.mail.MessagingException: Could not convert socket to TLS;
nested exception is:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
root cause
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
root cause
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
root cause
sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target