hlfw.ca

webbing

Download patch

ref: a1bdc124bfb3d96fa5b22275c5c46c3023dc05e4
parent: f69e3764fd85ccbb72ea675363d62b600a67ae41
author: Halfwit <halfwit@MacBook-Pro.hitronhub.home>
date: Thu Dec 12 12:19:17 PST 2019

rename to avoid confusion

--- a/router/cert.go
+++ /dev/null
@@ -1,21 +1,0 @@
-package router
-
-import (
-	"crypto/tls"
-)
-
-func getTlsConfig() *tls.Config {
-	tlsConfig := &tls.Config{
-		MinVersion:               tls.VersionTLS12,
-		CurvePreferences:         []tls.CurveID{tls.CurveP521, tls.CurveP384, tls.CurveP256},
-		PreferServerCipherSuites: true,
-		CipherSuites: []uint16{
-			tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
-			tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,
-			tls.TLS_RSA_WITH_AES_256_GCM_SHA384,
-			tls.TLS_RSA_WITH_AES_256_CBC_SHA,
-		},
-	}
-	tlsConfig.BuildNameToCertificate()
-	return tlsConfig
-}
--- a/router/handler.go
+++ b/router/handler.go
@@ -11,7 +11,6 @@
 )
 
 // Handle specific endpoints
-
 type handler struct {
 	manager *session.Manager
 }
@@ -138,7 +137,6 @@
 	return user, status, us, role
 }
 
-// Some utility functions that are shared across pages and forms
 func userLang(r *http.Request) *message.Printer {
 	accept := r.Header.Get("Accept-Language")
 	lang := r.FormValue("lang")
--- /dev/null
+++ b/router/tls.go
@@ -1,0 +1,21 @@
+package router
+
+import (
+	"crypto/tls"
+)
+
+func getTlsConfig() *tls.Config {
+	tlsConfig := &tls.Config{
+		MinVersion:               tls.VersionTLS12,
+		CurvePreferences:         []tls.CurveID{tls.CurveP521, tls.CurveP384, tls.CurveP256},
+		PreferServerCipherSuites: true,
+		CipherSuites: []uint16{
+			tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
+			tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,
+			tls.TLS_RSA_WITH_AES_256_GCM_SHA384,
+			tls.TLS_RSA_WITH_AES_256_CBC_SHA,
+		},
+	}
+	tlsConfig.BuildNameToCertificate()
+	return tlsConfig
+}