-
-
Save sescobb27/194e58c78a4568d21286 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// You don't want to serve HTTPS supporting for SSL3.0 any longer, see: | |
// http://googleonlinesecurity.blogspot.de/2014/10/this-poodle-bites-exploiting-ssl-30.html | |
import ( | |
"crypto/tls" | |
"net/http" | |
) | |
// This code supports SSL3.0, TLS1.0, TLS1.1 and TLS1.2 | |
// Chances are you currently do this but want to stop due to the POODLE | |
err := http.ListenAndServeTLS(addr, "crtfile", "keyfile", handler) | |
// This code instead supports TLS1.0, TLS1.1 and TLS1.2 | |
// But note that it may cause you compatibility problems | |
// (In particular, TLS_FALLBACK_SCSV is not handled) | |
config := &tls.Config{MinVersion: tls.VersionTLS10} | |
server := &http.Server{Addr: addr, Handler: handler, TLSConfig: config} | |
err := server.ListenAndServeTLS("crtfile", "keyfile") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment