Beispiel #1
0
func (self *Context) UseCertificate(cert *x509.Certificate) error {
	if int(C.SSL_CTX_use_certificate(self.Ctx, (*C.X509)(unsafe.Pointer(cert.GetX509())))) != 1 {
		return errors.New("problem loading cert " + sslerr.SSLErrorMessage().String())
	}
	return nil
}
Beispiel #2
0
func (self *Context) AddClientCA(cert *x509.Certificate) int {
	return int(C.SSL_CTX_add_client_CA(self.Ctx, (*C.X509)(unsafe.Pointer(cert.GetX509()))))
}