Skip to content

Commit c68a909

Browse files
committed
Attempt to allow all certificates
1 parent 54948ea commit c68a909

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

go/email_server.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import (
1212
"log"
1313
"math/big"
1414
"math/rand"
15-
"net"
1615
"os"
1716
"sync"
1817
"time"
@@ -223,15 +222,13 @@ func generateTLSConfig() (*tls.Config, error) {
223222
SerialNumber: serialNumber,
224223
Subject: pkix.Name{
225224
Organization: []string{"Self-Signed Cert"},
226-
CommonName: "localhost",
225+
CommonName: "*",
227226
},
228227
NotBefore: time.Now(),
229228
NotAfter: time.Now().AddDate(1, 0, 0),
230229
KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature,
231230
ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth},
232231
BasicConstraintsValid: true,
233-
IPAddresses: []net.IP{net.ParseIP("127.0.0.1")},
234-
DNSNames: []string{"localhost"},
235232
}
236233

237234
// Create the certificate
@@ -255,5 +252,12 @@ func generateTLSConfig() (*tls.Config, error) {
255252
// Return the TLS config
256253
return &tls.Config{
257254
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+
},
258262
}, nil
259263
}

0 commit comments

Comments
 (0)