Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

Add insecure_skip_verify option for HTTPS client in security.toml (#8781)

Chris Lu92c2fc0d5230
diff --git a/weed/command/scaffold/security.toml b/weed/command/scaffold/security.toml
index e70ce31bfa..6c8aaa4756 100644
--- a/weed/command/scaffold/security.toml
+++ b/weed/command/scaffold/security.toml
@@ -135,6 +135,7 @@ enabled = false # Set to true to enable HTTPS for all outgoing HTTP client conn
cert = "" # Client certificate for mTLS (optional if server doesn't require client cert)
key = "" # Client key for mTLS (optional if server doesn't require client cert)
ca = "" # CA certificate to verify server certificates (required when enabled=true)
+insecure_skip_verify = false # Skip TLS certificate verification (NOT recommended for production)
# Volume server HTTPS options (server-side)
# Enables HTTPS for incoming HTTP connections to volume server
diff --git a/weed/util/http/client/http_client.go b/weed/util/http/client/http_client.go
index 661df582e3..ca908763fb 100644
--- a/weed/util/http/client/http_client.go
+++ b/weed/util/http/client/http_client.go
@@ -126,6 +126,13 @@ func NewHttpClient(clientName ClientName, opts ...HttpClientOpt) (*HTTPClient, e
tlsConfig.Certificates = append(tlsConfig.Certificates, *clientCertPair)
}
}
+
+ if getBoolOptionFromSecurityConfiguration(clientName, "insecure_skip_verify") {
+ if tlsConfig == nil {
+ tlsConfig = &tls.Config{}
+ }
+ tlsConfig.InsecureSkipVerify = true
+ }
}
httpClient.Transport = &http.Transport{