Skip to content

Instantly share code, notes, and snippets.

@mmorris
Last active August 29, 2015 14:23
Show Gist options
  • Save mmorris/ac2ed3ccbcbde3e07fd6 to your computer and use it in GitHub Desktop.
Save mmorris/ac2ed3ccbcbde3e07fd6 to your computer and use it in GitHub Desktop.
Configuring TLS with Go for use with AFNetworking
func main()
{
cipherSuites := []uint16{tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256}
tlsconf := &tls.Config{MinVersion: tls.VersionTLS12, CipherSuites:cipherSuites}
server := &http.Server{Addr:":8008", Handler: nil, TLSConfig: tlsconf}
log.Fatal(server.ListenAndServeTLS("server.crt", "server.key.pem"))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment