INNER CODE UNIT · Go

setupTLSTrust

darksworm/argonaut · cmd/app/main.go:490

func setupTLSTrust(cfg TLSConfig) {
	// Only configure custom TLS trust if flags or environment variables are provided
	if cfg.CACertFile == "" && cfg.CACertDir == "" && cfg.ClientCertFile == "" && cfg.ClientKeyFile == "" &&
		os.Getenv("SSL_CERT_FILE") == "" && os.Getenv("SSL_CERT_DIR") == "" {
		return
	}

	// Configure trust options
	opts := trust.Options{
		CACertFile:     cfg.CACertFile,
		CACertDir:      cfg.CACertDir,
		ClientCertFile: cfg.ClientCertFile,
		ClientKeyFile:  cfg.ClientKeyFile,
		Timeout:        30 * time.Second, // Default HTTP timeout
		MinTLS:         tls.VersionTLS12, // Minimum TLS 1.2
	}

	// Load certificate pool

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…