// NewCtxWithVersion creates an SSL context that is specific to the provided // SSL version. See http://www.openssl.org/docs/ssl/SSL_CTX_new.html for more. func NewCtxWithVersion(version SSLVersion) (*Ctx, error) { var method *C.SSL_METHOD switch version { case SSLv3: method = C.SSLv3_method() case TLSv1: method = C.TLSv1_method() case TLSv1_1: method = C.OUR_TLSv1_1_method() case TLSv1_2: method = C.OUR_TLSv1_2_method() case AnyVersion: method = C.SSLv23_method() } if method == nil { return nil, errors.New("unknown ssl/tls version") } return newCtx(method) }
// SSLv3 method func SSLv3Method() *METHOD { return &METHOD{C.SSLv3_method()} }