瀏覽代碼

http: check https certificate against host name

Fixes #1093.

R=agl, agl1
CC=golang-dev
https://golang.org/cl/2115045
v1.2.3
Russ Cox 14 年之前
父節點
當前提交
657e8dab30
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. +7
    -0
      conn.go

+ 7
- 0
conn.go 查看文件

@@ -670,3 +670,10 @@ func (c *Conn) PeerCertificates() []*x509.Certificate {

return c.peerCertificates
}

// VerifyHostname checks that the peer certificate chain is valid for
// connecting to host. If so, it returns nil; if not, it returns an os.Error
// describing the problem.
func (c *Conn) VerifyHostname(host string) os.Error {
return c.PeerCertificates()[0].VerifyHostname(host)
}

Loading…
取消
儲存