Need to upgrade to TLS 1.2, Amazon SES called from EC2 instance running SmartFoxServer

0

Hello everyone,

I'm receiving messages from AWS telling me to upgrade to TLS 1.2 and am a bit at loss on how to do this.

SmartFoxServer 2x (SFS2X) version 2.15 on a Linux 2 EC2 instance. SFS2X comes with its own JRE / Apache configuration and you can run a Java program inside it which handles a multiplayer game's logic. In the build Libraries of that Java program I've added javax.mail.jar (version 1.6.2 I think, according to the manifest files inside it) which is supposed to support TLS 1.2.

The players on their mobile apps connect to the server via sockets and send commands, such as "send a new password to my e-mail" and so the Java program running on the server/EC2 instance makes a call to the SES endpoint using my verified credentials, and sends a reset password e-mail to the player.

This works fine, the player receives the e-mail. But I don't know why it's using TLS v1 or v1.1. As you'll see below 1.2 is forced programmatically with props.put("mail.smtp.ssl.protocols", "TLSv1.2");

If I run this command on Putty when connected to the instance

openssl ciphers -v | awk '{print $2}' | sort | uniq

It returns

SSLv3
TLSv1.2

So it seems to be enabled. My code looks like this:


Properties props = System.getProperties();
props.put("mail.transport.protocol", "smtp");
props.put("mail.smtp.port", 587);
props.put("mail.smtp.starttls.enable", "true");
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.ssl.protocols", "TLSv1.2");

// Create a Session object to represent a mail session with the specified properties.
Session session2 = Session.getDefaultInstance(props);

try {
    // Create a message with the specified information.

    MimeMessage msg = new MimeMessage(session2);
    msg.setFrom(new InternetAddress("MyVerifiedEmail@email.com","Game App"));
    msg.setRecipient(Message.RecipientType.TO, new InternetAddress("RecipientEmail@email.com"));
    msg.setSubject("Here is your new password");
    msg.setContent("Your new password is XYZ","text/html");

    // Add a configuration set header. Comment or delete the
    // next line if you are not using a configuration set
    //msg.setHeader("X-SES-CONFIGURATION-SET", CONFIGSET);  commented, not actually used

    // Create a transport.
    transport = session2.getTransport();

    // Send the message.
    ext.trace("Sending...");

    transport.connect("email-smtp.us-east-1.amazonaws.com", 587, MyUserName, MyPassword);

    // Send the email.
    transport.sendMessage(msg, msg.getAllRecipients());
    ext.trace("Email sent!");

    // Close and terminate the connection.
    transport.close();

}

Any clue would be much appreciated. Thank you

No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions