Unable to find valid certification path to requested target

Unable to find valid certification path to requested target:

Some of you guys might have faced this error while sending authenticated mails in ODI. Lets discuss on this. It will take at max 5 minutes to resolve. Today,  I got a mail from the admin section that they are not getting the daily notification from ODI.

Well I didn’t believe this first time when I heard about this as the package was working fine since 2 months. So I logged into production and searched the session for odisendmail. I found all sessions related SSL has got failed. The error was as follows

 

Exception in thread “Main Thread” java.lang.RuntimeException: javax.mail.MessagingException: Exception reading response;
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 SendMailSSL.main(SendMailSSL.java:48)
Caused by: javax.mail.MessagingException: Exception reading response;
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.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:1462)
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1260)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:370)

 

So I Googled on this error and found many resolution but non of them worked for me. Not sure what was the problem. I might be missing be something. After spending 1 hour,I found that the jdk path I have set in environmental variable is actually not used by ODI. The java_home location was pointing to the inbuilt jrockit directory. Here is the steps i have followed. I hope this will save some of your precious time guys.

 

Download the InstallCert.java from this link. Compile and run this file as follows.

javac InstallCert.java

java InstallCert <your_server_name>:<port_no>

for example java InstallCert smtp.bizmail.yahoo.com:465

During the execution it will ask you to enter some values. Press 1 to create a key for your server. Once this is done you can see a  jssecacerts file created in the directory where you have kept the .java file. At this point you are good to go.

 

Open ODIPARAMS.bat file and find out the actual jdk location used by ODI. For example

ODI_JAVA_HOME=D:\OdiStandloneInstall\jrockit

 

Open jrockit folder and then go to to jre\lib\security folder. Rename the existing cacerts file to cacerts_backup. Copy the jssecacerts created earlier to this location and rename to cacerts. Thats all. Restart ODI studio and execute the odisendmail. This time you should not have any issues as expected earlier.

Thanks for reading!!

0

About the author

Bhabani(http://dwteam.in) - Currently Bhabani is working as Sr Development Engineer at Harman International. He has good expertise on Oracle, Oracle Data Integrator, Pervasive Data Integrator, MSBI, Talend and Java. He is also contributing in ODI-OTN forum for last 5 years. He is from India. If you want to reach him then please visit contact us page. If you have any doubts or concerns on the above article, please put your question here. Dw Team will try to respond it as soon as possible. Also dont forget to provide your comments / suggestions / feedback for further improvement. Thanks for your time.

Similar Posts

2 comments

Thank you very much..
It works..

Hi when I using the above one I got the following error How can I resolve it

Starting SSL handshake… javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source) at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source) at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source) at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source) at InstallCert.main(InstallCert.java:92) Caused by: java.io.EOFException: SSL peer shut down incorrectly at sun.security.ssl.InputRecord.read(Unknown Source) … 5 more Could not obtain server certificate chain

Leave a reply

required*

Are you a human? *