mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8209031: SSLSocket should throw an exception when configuring DTLS
Reviewed-by: xuelei
This commit is contained in:
parent
7069bb6a72
commit
b27f471bdd
6 changed files with 70 additions and 166 deletions
|
@ -207,6 +207,10 @@ public abstract class SSLContextImpl extends SSLContextSpi {
|
|||
if (!isInitialized) {
|
||||
throw new IllegalStateException("SSLContext is not initialized");
|
||||
}
|
||||
if (isDTLS()) {
|
||||
throw new UnsupportedOperationException(
|
||||
"DTLS not supported with SSLSocket");
|
||||
}
|
||||
return new SSLSocketFactoryImpl(this);
|
||||
}
|
||||
|
||||
|
@ -215,6 +219,10 @@ public abstract class SSLContextImpl extends SSLContextSpi {
|
|||
if (!isInitialized) {
|
||||
throw new IllegalStateException("SSLContext is not initialized");
|
||||
}
|
||||
if (isDTLS()) {
|
||||
throw new UnsupportedOperationException(
|
||||
"DTLS not supported with SSLServerSocket");
|
||||
}
|
||||
return new SSLServerSocketFactoryImpl(this);
|
||||
}
|
||||
|
||||
|
@ -1261,6 +1269,21 @@ public abstract class SSLContextImpl extends SSLContextSpi {
|
|||
serverDefaultProtocols, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SSLParameters engineGetDefaultSSLParameters() {
|
||||
SSLEngine engine = createSSLEngineImpl();
|
||||
return engine.getSSLParameters();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SSLParameters engineGetSupportedSSLParameters() {
|
||||
SSLEngine engine = createSSLEngineImpl();
|
||||
SSLParameters params = new SSLParameters();
|
||||
params.setCipherSuites(engine.getSupportedCipherSuites());
|
||||
params.setProtocols(engine.getSupportedProtocols());
|
||||
return params;
|
||||
}
|
||||
|
||||
@Override
|
||||
List<ProtocolVersion> getSupportedProtocolVersions() {
|
||||
return supportedProtocols;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue