示例#1
0
文件: conn.go 项目: johnsonz/openssl
// Server wraps an existing stream connection and puts it in the accept state
// for any subsequent handshakes.
func Server(conn net.Conn, ctx *Ctx) (*Conn, error) {
	c, err := newConn(conn, ctx)
	if err != nil {
		return nil, err
	}
	C.SSL_set_accept_state(c.ssl)
	return c, nil
}
示例#2
0
文件: ssl.go 项目: partkyle/gossl
func (self *SSL) SetAcceptState() {
	C.SSL_set_accept_state(self.SSL)
}
示例#3
0
文件: ssl.go 项目: partkyle/gossl
func (self *SSL) SetBIO(readbio *BIO, writebio *BIO) {
	C.SSL_set_bio(self.SSL,
		(*C.BIO)(unsafe.Pointer(readbio.BIO)),
		(*C.BIO)(unsafe.Pointer(writebio.BIO)))
	C.SSL_set_accept_state(self.SSL)
}