Skip to content

Commit 68feb23

Browse files
authored
Check TLS connections to virtual servers are enabled (#2762)
1 parent c7a6cac commit 68feb23

File tree

1 file changed

+11
-0
lines changed
  • agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/init

1 file changed

+11
-0
lines changed

agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/init/FirstEntryPoint.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ public void init() {
101101
JvmCompiler.disableJvmCompilerDirectives();
102102
}
103103

104+
checkTlsConnectionsToVirtualServersEnabled();
105+
104106
if (startupLogger.isDebugEnabled()) {
105107
startupLogger.debug(
106108
"Input arguments: " + ManagementFactory.getRuntimeMXBean().getInputArguments());
@@ -128,6 +130,15 @@ public void init() {
128130
}
129131
}
130132

133+
private static void checkTlsConnectionsToVirtualServersEnabled() {
134+
String tlsConnectionsToVirtualServersProp = "jsse.enableSNIExtension";
135+
String propValue = System.getProperty(tlsConnectionsToVirtualServersProp);
136+
if ("false".equals(propValue)) {
137+
startupLogger.warn(
138+
"System property -Djsse.enableSNIExtension=false is detected. If you have connection issues with Application Insights, please remove this.");
139+
}
140+
}
141+
131142
private static String findSystemProperties() {
132143
Properties properties = System.getProperties();
133144
StringBuilder propsBuilder = new StringBuilder();

0 commit comments

Comments
 (0)