Skip to content

Commit 948ea66

Browse files
committed
fix(telemetry): 🔧 add TLS 1.2 version constraint to fix ssl3_get_record error
1 parent 5af3202 commit 948ea66

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

mcp/src/utils/telemetry.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ class TelemetryReporter {
116116
const urlObj = new URL(url);
117117
const client = urlObj.protocol === 'https:' ? https : http;
118118

119-
const options = {
119+
const options: any = {
120120
hostname: urlObj.hostname,
121121
port: urlObj.port,
122122
path: urlObj.pathname + urlObj.search,
@@ -129,6 +129,12 @@ class TelemetryReporter {
129129
timeout: 5000 // 5秒超时
130130
};
131131

132+
// 针对 TLS 版本问题的修复
133+
if (urlObj.protocol === 'https:') {
134+
options.minVersion = 'TLSv1.2';
135+
options.maxVersion = 'TLSv1.2';
136+
}
137+
132138
const req = client.request(options, (res) => {
133139
let responseData = '';
134140
res.on('data', (chunk) => {

0 commit comments

Comments
 (0)