mguessan / davmail

DavMail POP/IMAP/SMTP/Caldav/Carddav/LDAP Exchange and Office 365 Gateway - Synced with main subversion repository at
http://davmail.sourceforge.net
GNU General Public License v2.0
582 stars 86 forks source link

How to trust self-signed certificate #293

Closed sino1641 closed 1 year ago

sino1641 commented 1 year ago

Hi mguessan, Much thanks for the great work of the product. My company IT is using a self-signed cert with VPN to let employees access exchange owa outside. When I tried to set up DavMail in my linux desktop with all default config, there is an error message saying:

davmail  - > 421 DavMail configuration exception:
Connect exception: javax.net.ssl.SSLPeerUnverifiedException Certificate for <mail.company.com> 
doesn't match any of the subject alternative names: [vpn.company.com]

I wonder if there is some approaches to bypass the cert verification or trust the vpn cert? Thanks again.

esabol commented 1 year ago

I'm not sure about DavMail, but, for other Java applications, we add our self-signed certificates to $JAVA_HOME/jre/lib/security/cacerts. Refer to the following for instructions:

https://stackoverflow.com/questions/11617210/how-to-properly-import-a-selfsigned-certificate-into-java-keystore-that-is-avail

sino1641 commented 1 year ago

@esabol Hi Sabol, much thanks for the hint. I already tried using it before but it seems the common trust way cannot solve the error of different subject alternative names between domains and cert.

sino1641 commented 1 year ago

I think my scenario should consider as #300 which needs code changde.