commit
9540f13765
|
@ -82,20 +82,16 @@ public class WolfSSLContext extends SSLContextSpi {
|
||||||
method = WolfSSL.NOT_COMPILED_IN;
|
method = WolfSSL.NOT_COMPILED_IN;
|
||||||
switch (this.currentVersion) {
|
switch (this.currentVersion) {
|
||||||
case TLSv1:
|
case TLSv1:
|
||||||
if((ctxAttr.noOptions & WolfSSL.SSL_OP_NO_TLSv1) == 0)
|
method = WolfSSL.TLSv1_Method();
|
||||||
method = WolfSSL.TLSv1_Method();
|
|
||||||
break;
|
break;
|
||||||
case TLSv1_1:
|
case TLSv1_1:
|
||||||
if((ctxAttr.noOptions & WolfSSL.SSL_OP_NO_TLSv1_1) == 0)
|
method = WolfSSL.TLSv1_1_Method();
|
||||||
method = WolfSSL.TLSv1_1_Method();
|
|
||||||
break;
|
break;
|
||||||
case TLSv1_2:
|
case TLSv1_2:
|
||||||
if((ctxAttr.noOptions & WolfSSL.SSL_OP_NO_TLSv1_2) == 0)
|
method = WolfSSL.TLSv1_2_Method();
|
||||||
method = WolfSSL.TLSv1_2_Method();
|
|
||||||
break;
|
break;
|
||||||
case TLSv1_3:
|
case TLSv1_3:
|
||||||
if((ctxAttr.noOptions & WolfSSL.SSL_OP_NO_TLSv1_3) == 0)
|
method = WolfSSL.TLSv1_3_Method();
|
||||||
method = WolfSSL.TLSv1_3_Method();
|
|
||||||
break;
|
break;
|
||||||
case SSLv23:
|
case SSLv23:
|
||||||
method = WolfSSL.SSLv23_Method();
|
method = WolfSSL.SSLv23_Method();
|
||||||
|
|
|
@ -175,10 +175,7 @@ public class WolfSSLEngineHelper {
|
||||||
|
|
||||||
/* gets all supported protocols */
|
/* gets all supported protocols */
|
||||||
protected String[] getAllProtocols() {
|
protected String[] getAllProtocols() {
|
||||||
if(ssl != null)
|
return WolfSSL.getProtocols();
|
||||||
return WolfSSL.getProtocolsMask(ssl.getOptions());
|
|
||||||
else
|
|
||||||
return WolfSSL.getProtocols();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setUseClientMode(boolean mode)
|
protected void setUseClientMode(boolean mode)
|
||||||
|
|
|
@ -138,7 +138,7 @@ public class WolfSSLServerSocket extends SSLServerSocket {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String[] getSupportedProtocols() {
|
public String[] getSupportedProtocols() {
|
||||||
return WolfSSL.getProtocols();
|
return params.getProtocols();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -160,11 +160,7 @@ public class WolfSSLServerSocket extends SSLServerSocket {
|
||||||
|
|
||||||
/* sanitize protocol array for unsupported strings */
|
/* sanitize protocol array for unsupported strings */
|
||||||
List<String> supported;
|
List<String> supported;
|
||||||
if(context != null)
|
supported = Arrays.asList(WolfSSL.getProtocols());
|
||||||
supported = Arrays.asList(
|
|
||||||
WolfSSL.getProtocolsMask(context.getOptions()));
|
|
||||||
else
|
|
||||||
supported = Arrays.asList(WolfSSL.getProtocols());
|
|
||||||
|
|
||||||
for (int i = 0; i < protocols.length; i++) {
|
for (int i = 0; i < protocols.length; i++) {
|
||||||
if (!supported.contains(protocols[i])) {
|
if (!supported.contains(protocols[i])) {
|
||||||
|
|
Loading…
Reference in New Issue