Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
dc06ad5a
Commit
dc06ad5a
authored
Mar 10, 2011
by
Brad Fitzpatrick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tls: move PeerCertificates to ConnectionState
R=agl, agl1 CC=golang-dev, rsc
https://golang.org/cl/4248078
parent
dd5adcc3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
9 deletions
+5
-9
common.go
src/pkg/crypto/tls/common.go
+4
-0
conn.go
src/pkg/crypto/tls/conn.go
+1
-9
No files found.
src/pkg/crypto/tls/common.go
View file @
dc06ad5a
...
...
@@ -7,6 +7,7 @@ package tls
import
(
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"io"
"io/ioutil"
"sync"
...
...
@@ -95,6 +96,9 @@ type ConnectionState struct {
HandshakeComplete
bool
CipherSuite
uint16
NegotiatedProtocol
string
// the certificate chain that was presented by the other side
PeerCertificates
[]
*
x509
.
Certificate
}
// A Config structure is used to configure a TLS client or server. After one
...
...
src/pkg/crypto/tls/conn.go
View file @
dc06ad5a
...
...
@@ -762,6 +762,7 @@ func (c *Conn) ConnectionState() ConnectionState {
if
c
.
handshakeComplete
{
state
.
NegotiatedProtocol
=
c
.
clientProtocol
state
.
CipherSuite
=
c
.
cipherSuite
state
.
PeerCertificates
=
c
.
peerCertificates
}
return
state
...
...
@@ -776,15 +777,6 @@ func (c *Conn) OCSPResponse() []byte {
return
c
.
ocspResponse
}
// PeerCertificates returns the certificate chain that was presented by the
// other side.
func
(
c
*
Conn
)
PeerCertificates
()
[]
*
x509
.
Certificate
{
c
.
handshakeMutex
.
Lock
()
defer
c
.
handshakeMutex
.
Unlock
()
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.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment