Ejemplo n.º 1
0
// 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
}
Ejemplo n.º 2
0
func (self *SSL) SetAcceptState() {
	C.SSL_set_accept_state(self.SSL)
}
Ejemplo n.º 3
0
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)
}