예제 #1
0
파일: ctx.go 프로젝트: Machyne/mongo
// 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 TLSv1:
		method = C.TLSv1_method()
	case AnyVersion:
		method = C.SSLv23_method()
	}
	if method == nil {
		return nil, errors.New("unknown ssl/tls version")
	}
	return newCtx(method)
}
예제 #2
0
파일: methods.go 프로젝트: runcom/gossl
// TLSv1.0
func TLSv1Method() *METHOD {
	return &METHOD{C.TLSv1_method()}
}