I was experimenting with self-signed keys. I generated an elliptic curve key, and tried to use it with ListenAndServerTLS, and the http package panics when you use the certificate and private key pair:
http: panic serving
192.168.1.5:49165: interface conversion: interface is *ecdsa.PrivateKey, not *rsa.PrivateKey
goroutine 11 [running]:
net/http.func·006()
/home/dex/go/src/pkg/net/http/server.go:799 +0xac
crypto/tls.(*ecdheRSAKeyAgreement).generateServerKeyExchange(0xc200156080, 0xc2000e3000, 0xc2000b5690, 0xc2000b9870, 0xc20012c800, ...)
/home/dex/go/src/pkg/crypto/tls/key_agreement.go:154 +0x4d7
crypto/tls.(*serverHandshakeState).doFullHandshake(0x7f855af21d80, 0x7f855af21d00, 0x0)
/home/dex/go/src/pkg/crypto/tls/handshake_server.go:307 +0x41a
crypto/tls.(*Conn).serverHandshake(0xc2000e5280, 0x0, 0x0)
/home/dex/go/src/pkg/crypto/tls/handshake_server.go:80 +0x20e
crypto/tls.(*Conn).Handshake(0xc2000e5280, 0x0, 0x0)
/home/dex/go/src/pkg/crypto/tls/conn.go:844 +0xec
net/http.(*conn).serve(0xc20012c780)
/home/dex/go/src/pkg/net/http/server.go:814 +0x1c8
created by net/http.(*Server).Serve
/home/dex/go/src/pkg/net/http/server.go:1338 +0x266
openssl req -new -key key.pem -out server.csr
openssl x509 -req -days 365 -in server.csr -signkey key.pem -out server.crt
Is this because net/http's TLS functionality only supports RSA?
I am currently at version
go version devel +131f8c8eb722 Wed Mar 06 16:52:03 2013 -0800 linux/amd64