@@ -1176,6 +1176,38 @@ else if (ret == WolfSSL.NOT_COMPILED_IN) {
1176
1176
}
1177
1177
}
1178
1178
1179
+ private void setLocalExtendedMasterSecret () {
1180
+ /* Native wolfSSL enables TLS Extended Master Secret by default.
1181
+ * Check the Java System property (jdk.tls.useExtendedMasterSecret)
1182
+ * to see if the user has explicitly disabled it. */
1183
+ int ret ;
1184
+ boolean useEMS = WolfSSLUtil .useExtendedMasterSecret ();
1185
+
1186
+ if (!useEMS ) {
1187
+ ret = this .ssl .disableExtendedMasterSecret ();
1188
+ if (ret == WolfSSL .SSL_SUCCESS ) {
1189
+ WolfSSLDebug .log (getClass (), WolfSSLDebug .INFO ,
1190
+ "TLS Extended Master Secret disabled due to " +
1191
+ "jdk.tls.useExtendedMasterSecret System property" );
1192
+ }
1193
+ else {
1194
+ WolfSSLDebug .log (getClass (), WolfSSLDebug .INFO ,
1195
+ "Failed to disable TLS Extended Master Secret, " +
1196
+ "ret = " + ret );
1197
+ }
1198
+ }
1199
+ else {
1200
+ if (WolfSSL .isEnabledTLSExtendedMasterSecret () == 1 ) {
1201
+ WolfSSLDebug .log (getClass (), WolfSSLDebug .INFO ,
1202
+ "using TLS Extended Master Secret" );
1203
+ }
1204
+ else {
1205
+ WolfSSLDebug .log (getClass (), WolfSSLDebug .INFO ,
1206
+ "not using TLS Extended Master Secret, not compiled in" );
1207
+ }
1208
+ }
1209
+ }
1210
+
1179
1211
private void setLocalParams (SSLSocket socket , SSLEngine engine )
1180
1212
throws SSLException {
1181
1213
@@ -1192,6 +1224,7 @@ private void setLocalParams(SSLSocket socket, SSLEngine engine)
1192
1224
this .setLocalSigAlgorithms ();
1193
1225
this .setLocalSupportedCurves ();
1194
1226
this .setLocalMaximumPacketSize ();
1227
+ this .setLocalExtendedMasterSecret ();
1195
1228
}
1196
1229
1197
1230
/**
0 commit comments