Skip to content

Instantly share code, notes, and snippets.

@sescobb27
Forked from olov/gist:eb60ab878eb73a7c5e22
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sescobb27/194e58c78a4568d21286 to your computer and use it in GitHub Desktop.
Save sescobb27/194e58c78a4568d21286 to your computer and use it in GitHub Desktop.
// 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