@@ -12,7 +12,6 @@ import (
12
12
"log"
13
13
"math/big"
14
14
"math/rand"
15
- "net"
16
15
"os"
17
16
"sync"
18
17
"time"
@@ -223,15 +222,13 @@ func generateTLSConfig() (*tls.Config, error) {
223
222
SerialNumber : serialNumber ,
224
223
Subject : pkix.Name {
225
224
Organization : []string {"Self-Signed Cert" },
226
- CommonName : "localhost " ,
225
+ CommonName : "* " ,
227
226
},
228
227
NotBefore : time .Now (),
229
228
NotAfter : time .Now ().AddDate (1 , 0 , 0 ),
230
229
KeyUsage : x509 .KeyUsageKeyEncipherment | x509 .KeyUsageDigitalSignature ,
231
230
ExtKeyUsage : []x509.ExtKeyUsage {x509 .ExtKeyUsageServerAuth },
232
231
BasicConstraintsValid : true ,
233
- IPAddresses : []net.IP {net .ParseIP ("127.0.0.1" )},
234
- DNSNames : []string {"localhost" },
235
232
}
236
233
237
234
// Create the certificate
@@ -255,5 +252,12 @@ func generateTLSConfig() (*tls.Config, error) {
255
252
// Return the TLS config
256
253
return & tls.Config {
257
254
Certificates : []tls.Certificate {cert },
255
+ // This is the key configuration - the server won't verify client hostnames
256
+ InsecureSkipVerify : true ,
257
+ ClientAuth : tls .NoClientCert ,
258
+ // Skip hostname verification completely - accept ANY hostname
259
+ VerifyConnection : func (state tls.ConnectionState ) error {
260
+ return nil // Always approve the connection
261
+ },
258
262
}, nil
259
263
}
0 commit comments