diff options
Diffstat (limited to 'src/regress/lib/libtls/gotls/tls.go')
-rw-r--r-- | src/regress/lib/libtls/gotls/tls.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/regress/lib/libtls/gotls/tls.go b/src/regress/lib/libtls/gotls/tls.go index cf3e84c030..3601828884 100644 --- a/src/regress/lib/libtls/gotls/tls.go +++ b/src/regress/lib/libtls/gotls/tls.go | |||
@@ -202,6 +202,15 @@ func (t *TLS) PeerCertIssuer() (string, error) { | |||
202 | return C.GoString(issuer), nil | 202 | return C.GoString(issuer), nil |
203 | } | 203 | } |
204 | 204 | ||
205 | // PeerCertCommonName returns the common name of the peer certificate. | ||
206 | func (t *TLS) PeerCertCommonName() (string, error) { | ||
207 | commonName := C.tls_peer_cert_common_name(t.ctx) | ||
208 | if commonName == nil { | ||
209 | return "", errors.New("no peer cert common name returned") | ||
210 | } | ||
211 | return C.GoString(commonName), nil | ||
212 | } | ||
213 | |||
205 | // PeerCertSubject returns the subject of the peer certificate. | 214 | // PeerCertSubject returns the subject of the peer certificate. |
206 | func (t *TLS) PeerCertSubject() (string, error) { | 215 | func (t *TLS) PeerCertSubject() (string, error) { |
207 | subject := C.tls_peer_cert_subject(t.ctx) | 216 | subject := C.tls_peer_cert_subject(t.ctx) |