java starttls connection error

Hi, I’m having issues with SSL certificate configuration in KumoMTA when connecting via Java client.

Steps performed:

  1. Generated DKIM and SSL certificates:
# DKIM setup
export DOMAIN="<my-domain>"
export SELECTOR="s1"
openssl genrsa -f4 -out /opt/kumomta/etc/dkim/$DOMAIN/$SELECTOR.key 1024
openssl rsa -in /opt/kumomta/etc/dkim/$DOMAIN/$SELECTOR.key -outform PEM -pubout -out /opt/kumomta/etc/dkim/$DOMAIN/$SELECTOR.pub

# SSL cert generation
openssl req -x509 -newkey rsa:2048 -keyout smtp.key -out smtp.crt -days 365 -nodes \
   -subj "/CN=$DOMAIN" \
   -addext "subjectAltName=DNS:$DOMAIN"
openssl x509 -in smtp.crt -out smtp_cert.pem

2. Configured certificates:
sudo mv smtp.key smtp_cert.pem /opt/kumomta/etc/dkim/$DOMAIN/
sudo chown kumod:kumod /opt/kumomta/etc/dkim/$DOMAIN/smtp*
sudo chmod 600 /opt/kumomta/etc/dkim/$DOMAIN/smtp.key

Issue: When connecting to SMTP server using Java client with STARTTLS, getting error:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Context:

Using Java 8
Other SMTP servers connect successfully to same Java app. 
Certificate was generated with the proper domain name and SAN

What configuration changes are needed to resolve this SSL validation error?

It doesn’t look like you’re having the TLS certificate signed by a certificate authority

But please provide the full information as requested by the bot if you want more help

Without seeing your config it is difficult to help.
You can test with seals and use the trace facility to expose the problem

You can also “prefer OpenSSL”

Also you may need to specifically declare the file locations.

See point 4 here:

I used openssl to sign the certificate. is there any doc to use let’s Encrypt as signing authority for tls certificate? Also, I am confused about the DKIM and tls certificates used here.

Can you elaborate more on your confusion here?
Also, I am confused about the DKIM and tls certificates used here.
Do you just not understand how DKIM works, or do you need explanation about how it specifically works in KumoMTA?

LetsEncrypt is used to sign your TLS certificate, which you need in order for inbound/outbound connections that require TLS

DKIM is a way to essentially sign your SMTP cryptographically. You generate the DKIM keys on the server, then you have to paste the key (in the correct format) into a TXT record on your domain.

@heroic-tortoise is this issue resolved now?