- Related Products
- ADManager Plus
- ADSelfService Plus
- EventLog Analyzer
- Exchange Reporter Plus
- AD360
- Log360
javax.net.ssl.SSLHandshakeException: sun.security.validatorException:PKIX path building failed:sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certificate path to requested target
While using TLS or SSL, Java might not recognize the email server certificates.
In this case, you must manually import the email server, issuer, and root certificates into ADAudit Plus.
If you do not have the email server certificates, use the OpenSSL tool to retrieve them from the email server by following these steps:
Openssl s_client -connect <mail server name>:<sslport>
Openssl s_client -connect <mail server name>:<tlsport> -starttls smtp
To import the certificates into ADAudit Plus:
ImportCert.bat -add "aliasName" "certificateName"
Note: To check if the certificates have been imported, open Command Prompt, navigate to <ADAudit Plus_Installation directory>\bin, and execute the following command:
ImportCert.bat -list > Certificate.txt
When this command is executed, you will find a text file named Certificate in the <ADAudit Plus_Installation directory>\bin folder. Open the file and verify that the required certificates are in the file.
Once the downloaded certificates are imported successfully, you should be able to send emails. However, if the issue persists, contact support@adauditplus.com.
javax.net.ssl.SSLHandshakeException cannot be cast to javax .mail.MessagingException
This exception occurs when the ADAudit Plus server and email server are unable to communicate. This could happen when an incorrect port or incorrect secure connection details are used.
Check if the email can be sent via the email server using one of the following:
Note: The Backspace key cannot be used in the Telnet session once you connect to the destination SMTP server. If you make a mistake as you type an SMTP command, you should press Enter and retype the command.
set localecho
set logfile <filename>
OPEN <mail server name> <port>
EHLO <mail server name>
Command Prompt will return the list of supported commands.
MAIL FROM:<your_name@yourdomain.com>
Command Prompt should return the message "250 2.1.0 Sender OK".
RCPT TO:<recipient@recipientdomain.com> NOTIFY=success,failure
Note: The NOTIFY command is optional. In this example, it is used to request a delivery status notification that indicates whether message delivery succeeded or failed.
openssl s_client -connect <mail server name>:<sslport>
openssl s_client -connect <mail server name>:<tlsport> -starttls smtp
EHLO <mail server name>
AUTH LOGIN
MAIL FROM:<your_name@yourdomain.com>
RCPT TO:<recipient@recipientdomain.com>
java -cp "<ADAudit Plus_Installation directory>\lib\Mail-1.4.4.jar;." TestMail
Server Name/IP | Enter your email server name. |
---|---|
Port | Enter the port used by your email server. |
Secure Connection (SSL/TLS) | Specify which connection you want to use. |
From Mail | Enter the sender's email address. |
Password | Enter the password. |
To Mail | Enter the recipient's email address. |
Subject | Enter the subject. |
Message | Enter your message. |
Once you specify the details above, you will receive the "250 2.0.0 OK" confirmation if the email was sent successfully.
If you are unable to send the email, the issue is likely in the email server. Please check if your email server settings are configured correctly. If you are able to send the email successfully, but the exception persists, contact support@adauditplus.com to resolve the problem.