예제 #1
0
파일: conn.go 프로젝트: Machyne/mongo
// GetVerifyResult gets result of peer certificate verification
// SSL_get_verify_result() returns the result of the verification of the X509
// certificate presented by the peer, if any. See
// https://www.openssl.org/docs/ssl/SSL_get_verify_result.html
func (c *Conn) GetVerifyResults() error {
	result := C.SSL_get_verify_result(c.ssl)
	if int(result) != 0 {
		return errors.New(C.GoString(
			C.X509_verify_cert_error_string(result)))
	}
	return nil
}
예제 #2
0
파일: conn.go 프로젝트: johnsonz/openssl
func (c *Conn) VerifyResult() VerifyResult {
	return VerifyResult(C.SSL_get_verify_result(c.ssl))
}