AWS dropwizard app unable to find valid certification path to requested target - amazon-ec2

I have a dropwizard app running on AWS EC2. Recently i started getting this error when trying to reach MailGun or Twilio APIs
sun.security.provider.certpath.SunCertPathBuilderException: unable to
find valid certification path to requested target
! at
sun.security.provider.certpath.SunCertPathBuilder.engineBuild(
SunCertPathBuilder.java:196) ~[na:1.7.0_91]
! at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:268)
~[na:1.7.0_91]
! at sun.security.validator.PKIXValidator.doBuild(
PKIXValidator.java:380) ~[na:1.7.0_91]
! ... 79 common frames omitted
! Causing: sun.security.validator.ValidatorException: PKIX path building
failed: sun.security.provider.certpath.SunCertPathBuilderException:
unable to find valid certification path to requested target
! at
sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:385) ~ .
[na:1.7.0_91]
! at
sun.security.validator.PKIXValidator.engineValidate(
PKIXValidator.java:292) ~[na:1.7.0_91]
! at sun.security.validator.Validator.validate(Validator.java:260) ~ .
[na:1.7.0_91]
! at sun.security.ssl.X509TrustManagerImpl.validate(
X509TrustManagerImpl.java:326) ~[na:1.7.0_91]
! at
sun.security.ssl.X509TrustManagerImpl.checkTrusted(
X509TrustManagerImpl.java:231) ~[na:1.7.0_91]
! at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(
X509TrustManagerImpl.java:126) ~[na:1.7.0_91]
! at
sun.security.ssl.ClientHandshaker.serverCertificate(
ClientHandshaker.java:1454) ~[na:1.7.0_91]
! ... 73 common frames omitted
Not sure how to move forward. Should i install Twilio & MailGun's certs on my server? Or is there a config i need to do?
Thanks in advance.

Related

How to configure spring boot application to use SSL/TLS over mariadb?

Connection string
url: jdbc:mariadb://xyz:3306/test?useSSL=true&trustStore=classpath:/path/truststore.jks&trustStorePassword=mypwd&keystoreStore=classpath:/path/keystore.jks&keystoreStorePassword=mypwd
when i connect mairadb with tls/ssl connection getting this error
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
how to connect ssl connection using mariadb in spring boot

Spring call to https backend - handshake issue

I'm struggling with a problem recently.
I have to make an HTTP call to a secured backend using SPRING restTemplate !
It works smoothly for http endpoint but for an https it gives me the following error:
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
I have already resolved this issue before importin the certificate to the cacerts in the jre/security of the JDK.
It would be best for me finding a way not to do this thing for every machine i deploy my .war on.
Any clues ?
Thanks in advance

Service management page is not working in CAS - 3.4.12.1

Trying to open this page - https://:8443/cas/services/manage.html - it redirects to CAS Login Page- after putting the username/password it redirects to https://:8443/cas/services/j_acegi_cas_security_check?ticket=ST-10-Lhl4toafxJdCZLu7gkLN- and give me an 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.

Trouble with Axis2 https client

I have the same problem as in:
Unable to access axis2 over https
but in my case when I make a request with a client I've written to a third-party https server....
INFO org.apache.commons.httpclient.HttpMethodDirector - I/O exception (org.apache.axis2.AxisFault) caught when processing request: Connection has been shutdown: 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
Any idea what can I do or what should I configure in my client?¿
Thanks in advance!!

SQL Developer error

I'm trying to use SQL developer, but it won't connect using the proxy I specify in the preferences. I guess it's because of some kind of certificate error? Not sure. I'm getting the error:
No HTTP response received.
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.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:174)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1591)
at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:187)
at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:181)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:975)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:123)
at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:516)
at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java:454)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:884)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1096)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1123)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1107)
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:405)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:166)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:133)
at oracle.ide.webbrowser.HttpPing$PingRunnable.run(HttpPing.java:109)
at oracle.ide.webbrowser.ProxyOptions.doTask(ProxyOptions.java:522)
at oracle.ide.webbrowser.HttpPing.ping(HttpPing.java:74)
at oracle.ide.webbrowser.ProxySettingsPanel$5.run(ProxySettingsPanel.java:766)
at java.lang.Thread.run(Thread.java:619)
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:285)
at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:191)
at sun.security.validator.Validator.validate(Validator.java:218)
at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:126)
at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:209)
at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:249)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:954)
... 15 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:174)
at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:238)
at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:280)
... 21 more
This most likely means that the web server you are connecting to by SSL uses a certificate issued by an unknown authority. You want to add the certificate to your keystore (on the client).
See this article for instructions.
I think you don't install jdk yet. I recommand you if you use sql developer 1.5.1, you should use jdk 1.5.
One of the first rules of debugging errors: Google the error message you're getting, in quotes, like this: "unable to find valid certification path to". When I did this, I found lots of useful information that is probably relevant to you.

Resources