How to configure trustStore for javax.net.ssl.trustStore on windows?

前端 未结 3 674
猫巷女王i
猫巷女王i 2020-12-06 18:06

I\'m trying to pull messages from an email server in java using imap and i run into this exception:

DEBUG: JavaMail version 1.4.2
DEBUG: successfully loaded          


        
3条回答
  •  -上瘾入骨i
    2020-12-06 18:55

    Actually all you need to do is use Windows-ROOT as trustStoreType. This will use built-in certificates so if anything works in your browser then it should work.

    1. Add to VM options:
      • -Djavax.net.ssl.trustStoreType=Windows-ROOT
      • -Djavax.net.ssl.trustStore=C:\\Windows\\win.ini
    2. Restart the server.

    Note! Probably any readable file can be used as a trustStore path. It's not really used.

    You can also use Windows-MY instead so:

    -Djavax.net.ssl.trustStoreType=Windows-MY
    

    See also: https://github.com/gradle/gradle/issues/6584#issuecomment-431862413.

提交回复
热议问题