javamail - java mail api (1.5.3) not working in recent jre1.8.25 -
im using javamail send mail in application. every thing works fine. when change runtime jre1.8.25, got exception as
nested exception is: javax.net.ssl.sslkeyexception: rsa premaster secret error @ com.sun.mail.smtp.smtptransport.openserver(smtptransport.java:2056) @ com.sun.mail.smtp.smtptransport.protocolconnect(smtptransport.java:697) @ javax.mail.service.connect(service.java:364) @ mainclass.main(mainclass.java:44) caused by: javax.net.ssl.sslkeyexception: rsa premaster secret error @ sun.security.ssl.rsaclientkeyexchange.<init>(rsaclientkeyexchange.java:86) @ sun.security.ssl.clienthandshaker.serverhellodone(clienthandshaker.java:880) @ sun.security.ssl.clienthandshaker.processmessage(clienthandshaker.java:344) @ sun.security.ssl.handshaker.processloop(handshaker.java:936) @ sun.security.ssl.handshaker.process_record(handshaker.java:871) @ sun.security.ssl.sslsocketimpl.readrecord(sslsocketimpl.java:1043) @ sun.security.ssl.sslsocketimpl.performinitialhandshake(sslsocketimpl.java:1343) @ sun.security.ssl.sslsocketimpl.starthandshake(sslsocketimpl.java:1371) @ sun.security.ssl.sslsocketimpl.starthandshake(sslsocketimpl.java:1355) @ com.sun.mail.util.socketfetcher.configuresslsocket(socketfetcher.java:574) @ com.sun.mail.util.socketfetcher.createsocket(socketfetcher.java:369) @ com.sun.mail.util.socketfetcher.getsocket(socketfetcher.java:236) @ com.sun.mail.smtp.smtptransport.openserver(smtptransport.java:2020) ... 3 more caused by: java.security.nosuchalgorithmexception: suntlsrsapremastersecret keygenerator not available @ javax.crypto.keygenerator.<init>(keygenerator.java:158) @ javax.crypto.keygenerator.getinstance(keygenerator.java:207) @ sun.security.ssl.jssejce.getkeygenerator(jssejce.java:272) @ sun.security.ssl.rsaclientkeyexchange.<init>(rsaclientkeyexchange.java:77) ... 15 more
note: im using latest version of javamail api only.
make sure correct sunjce_provider.jar
on classpath. if it's in $java_home/lib/ext/
, java should find automatically.
see also:
Comments
Post a Comment