38 */ |
38 */ |
39 |
39 |
40 import java.io.ByteArrayInputStream; |
40 import java.io.ByteArrayInputStream; |
41 import java.io.InputStream; |
41 import java.io.InputStream; |
42 import java.io.OutputStream; |
42 import java.io.OutputStream; |
|
43 import java.io.IOException; |
43 import java.security.KeyStore; |
44 import java.security.KeyStore; |
44 import java.security.KeyFactory; |
45 import java.security.KeyFactory; |
45 import java.security.cert.Certificate; |
46 import java.security.cert.Certificate; |
46 import java.security.cert.CertificateFactory; |
47 import java.security.cert.CertificateFactory; |
47 import java.security.interfaces.ECPrivateKey; |
48 import java.security.interfaces.ECPrivateKey; |
48 import java.security.spec.PKCS8EncodedKeySpec; |
49 import java.security.spec.PKCS8EncodedKeySpec; |
49 import java.util.Base64; |
50 import java.util.Base64; |
50 import javax.net.ssl.KeyManagerFactory; |
51 import javax.net.ssl.KeyManagerFactory; |
51 import javax.net.ssl.SSLContext; |
52 import javax.net.ssl.SSLContext; |
52 import javax.net.ssl.SSLHandshakeException; |
|
53 import javax.net.ssl.SSLServerSocket; |
53 import javax.net.ssl.SSLServerSocket; |
54 import javax.net.ssl.SSLServerSocketFactory; |
54 import javax.net.ssl.SSLServerSocketFactory; |
55 import javax.net.ssl.SSLSocket; |
55 import javax.net.ssl.SSLSocket; |
56 import javax.net.ssl.SSLSocketFactory; |
56 import javax.net.ssl.SSLSocketFactory; |
57 import javax.net.ssl.TrustManagerFactory; |
57 import javax.net.ssl.TrustManagerFactory; |
139 sslIS.read(); |
139 sslIS.read(); |
140 sslOS.write('A'); |
140 sslOS.write('A'); |
141 sslOS.flush(); |
141 sslOS.flush(); |
142 |
142 |
143 throw new Exception("EC curve secp224k1 should be disabled"); |
143 throw new Exception("EC curve secp224k1 should be disabled"); |
144 } catch (SSLHandshakeException she) { |
144 } catch (IOException she) { |
145 // expected exception: no cipher suites in common |
145 // expected exception: no cipher suites in common |
146 System.out.println("Expected exception: " + she); |
146 System.out.println("Expected exception: " + she); |
147 } finally { |
147 } finally { |
148 sslSocket.close(); |
148 sslSocket.close(); |
149 sslServerSocket.close(); |
149 sslServerSocket.close(); |