I know that it is possible to disable TLSv1.0 (or others) in Java using JVM parameters as mentioned in Question 1 or Question 2.
Is there any way to disable it in an android App?
I am using JSch to do ssh port forwarding but I don't want TLS Client Hello in TLSv1.0. JSch doesn't have any API for using TLSv1.2 only.
So I decided to disable TLSv1.0 application wide.
I already used this but no success.
System.setProperty("https.protocols", "TLSv1.2");
Security.getProviders()
SSLContext.getDefault().getSupportedSSLParameters().setAlgorithmConstraints(algo);
Related
I'm working on a java mail client (part of a web application running in tomcat 8)
and the web application needs to be able to send (not recieve) mails.
My web application allows to be configured in a few different ways and I cannot test them all at the moment.
Im using the standard java mail api (https://javamail.java.net/nonav/docs/api/com/sun/mail/smtp/package-summary.html)
At the moment I do have an exchange account and my application is working with STARTTLS & Auth. Mechanisms LOGIN & PLAIN to send mails.
The thing I cannot test is SSL (instead of STARTTLS) and NTLM as the Auth. Mechanism. The exchange server is not my own and I cannot have it configured to be working with these settings.
Does anyone know a way to set up a local mail server so I can test a configuration using SSL & NTLM?
Edit:
I tried hMailServer to test at least the SSL setting but I came across the following problem:
IMAP/SMTP over SSL (using my own SSL cert) is working fine untill I uncheck TLS v1, v1.2 & v1.2 in Settings -> Advanced -> SSL/TLS.
The hMailServer Logfile shows that the connection upon sending mails (using thunderbird with 2 accounts added) is always using TLS.
I would want the connection to run on SSL v3.0 (I know its not the best option but I want to give my application the option to use SSL instead of TLS anyways)
How can I get the connection to be using SSL v3.0?
You can try installing hMailServer in Windows.
https://www.hmailserver.com or you can try setting SMTP in windows8.
http://www.neatcomponents.com/enable-SMTP-in-Windows-8
I wrote a simple app to send email to our smtp server. Java version is 1.8.0_101
Our server use only TLSv1.2. I wrote a simple app to send email to our server. I build this soft as jar and run it. It works normally and java use default tls version which is 1.2 on jdk1.8. Then I wrote a web service that accept request and send email to out smtp server. I use tomcat v9.0(also tested v7 and v8) I build war file and put the tomcat web app folder. But when I call my web service I got the below error
Could not convert socket to TLS.
Remote host closed connection during handshake
Then I realized that java does not use TLSv1.2 and use TLSv1. I tried lots of solution but no ones helped me. I could not change TLS version. Is there any way to change TLS version? Do I change this config on java side or tomcat?
Is it possible to update password in Active Directory where SSL is not enabled from a Java application?
It's not possible until you will have at least 128-bit connection. That is with TLS or SSL connection. You can use LDAPS to have secure connection, for example from here:
http://docs.oracle.com/javase/jndi/tutorial/ldap/security/ssl.html
Or you can just setup SSL checking this tutorial:
http://blogs.msdn.com/b/alextch/archive/2012/05/15/how-to-set-active-directory-password-from-java-application.aspx
Is there any way to disable the use of TLS v1.1 (and v1) for all SSL configured listeners in Glassfish 4.1? I've tried to set the JVM property
-Ddeployment.security.TLSvX.Y=false
as recommended by this Oracle blog post (https://blogs.oracle.com/java-platform-group/entry/java_8_will_use_tls) but the protocols are still being used in the https negotiations.
Ok, i've found how to do it by messing around with Glassfish command interface.
Run the following commands:
asadmin set configs.config.server-config.network-config.protocols.protocol.http-listener-2.ssl.tls-enabled=false
asadmin set configs.config.server-config.network-config.protocols.protocol.http-listener-2.ssl.tls11-enabled=false
And this will leave only TLSv1.2 enabled. This commands are run against the default HTTPS listener (port 8181), so remember to run against any other secure HTTP listener if you need to.
I am trying at write a java program that hits a url over ssl, and prints out the response to find out if the application on this port is running or not. We are using 2way ssl. I am fairly new to working with ssl and java security. Right now I am getting this error
Remote host closed connection during handshake
I am using this command to run the program
java -Djavax.net.ssl.trustStore=rs.truststore TmpUtil
Is there a way to find out what am I doing wrong and where exactly is the problem ?
You can generally debug an SSL/TLS connection that uses the JSSE in Java using the javax.net.debug system property. You'll find more details in the documentation.
Since you're after client-certificate authentication, it's most likely that your application needs a keystore to be configured. You'll find some details about the difference between keystore and truststore in this answer, and in the JSSE Reference Guide of course.