0

I got the following exception while connecting to Mail server from IBM WAS.

javax.mail.MessagingException: Could not convert socket to TLS; nested exception is: java.net.SocketException: java.security.PrivilegedActionException: java.io.FileNotFoundException: D:\Program Files (x86)\IBM\WebSphere\AppServer\jre\lib\security\cacerts (The system cannot find the path specified.)

My question is:

What is the certificate that I should import? Is it the mail server's certificate which needs to be imported into WAS? Should I ask the mail server admin to share the certificate?

Once I figure out which certificate, I plan to follow these instructions to import it: How to connect to a secure website using SSL in Java with a pkcs12 file?

Community
  • 1
  • 1
Teddy
  • 4,009
  • 2
  • 33
  • 55

1 Answers1

1

That link is not the correct way to use mail sessions in WAS. Check this Websphere 7 javax.mail.MessagingException: SSLSocketFactory is null.

Try to use default SSL WebSphere configuration and Mail session resource. You will need to add your mail server certificate to the Trust store (NodeDeaultTrustStore or CellDefaultTrustStore depending whether you use standalone or network deployment version).

It should be possible to get mail server cert using a browser, when you connect using https://mailserver:port/ it should give you certificate which you could save locally and add to truststore. If you will have problems contact mail server admin.

PrivilegedActionException also suggest that you may have Java 2 security enabled. Check if it is enabled and if you really need it.

Community
  • 1
  • 1
Gas
  • 17,601
  • 4
  • 46
  • 93