There are 2 ways :
1) If it is for the whole application add the below vm option
-Dhttps.protocols=TLSv1,TLSv1.1,TLSv1.2
2) Set specific SSL context for service
SSLContext context = SSLContext.getInstance("TLSv1.2");
1) If it is for the whole application add the below vm option
-Dhttps.protocols=TLSv1,TLSv1.1,TLSv1.2
2) Set specific SSL context for service
SSLContext context = SSLContext.getInstance("TLSv1.2");
context.init(null,null,null); SSLContext.setDefault(context);