I am connecting email using imap
Store store = session.getStore("imaps");
store.connect(server, username, password);
The code is working fine and email is connected while running the project inlocal
But if we run the project in docker container. Below error is thrown.
javax.mail.MessagingException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate);
nested exception is:
javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:665)
Docker File
FROM markhobson/maven-chrome:latest
WORKDIR /app
ARG ENVUrl=''
ENV ENVUrl $ENVUrl
ENV JAVA_OPTS="-Djava.awt.headless=true -Dmail.smtp.starttls.enable=true -Dmail.smtp.ssl.protocols=TLSv1.2"
COPY ./Framework .