获取支持的密码
// Licensed to the Apache Software Foundation (ASF) under one import org.apache.log4j.Logger; import javax.net.ssl.SSLContext; /** * nowjava.com - 时 代 Java 提 供 **/ import java.security.NoSuchAlgorithmException; import java.security.NoSuchProviderException; import java.util.Arrays; import java.util.HashSet; import java.util.Set; public class Main{ public static String[] getSupportedCiphers() throws NoSuchAlgorithmException { String[] availableCiphers = getSSLContext().getSocketFactory() .getSupportedCipherSuites(); Arrays.sort(availableCiphers); return availableCiphers; } public static SSLContext getSSLContext() throws NoSuchAlgorithmException { /* 时 代 J a v a 公 众 号 - nowjava.com 提 供 */ return SSLContext.getInstance("TLSv1"); } public static