46 static unsigned char npn_spdy3[] = {0x06,
47 0x73,0x70,0x64,0x79,0x2f,0x33};
51 return SSL_TLSEXT_ERR_OK;
82 if(
NULL == (daemon->
io_context = SSL_CTX_new(TLSv1_server_method())))
94 options = SSL_OP_NO_TICKET;
95 #ifdef SSL_OP_NO_COMPRESSION
96 options |= SSL_OP_NO_COMPRESSION;
97 #elif OPENSSL_VERSION_NUMBER >= 0x00908000L
98 sk_SSL_COMP_zero(SSL_COMP_get_compression_methods());
101 SSL_CTX_set_options(daemon->
io_context, options);
102 if(1 != SSL_CTX_use_certificate_file(daemon->
io_context, daemon->
certfile , SSL_FILETYPE_PEM))
108 if(1 != SSL_CTX_use_PrivateKey_file(daemon->
io_context, daemon->
keyfile, SSL_FILETYPE_PEM))
116 if (1 != SSL_CTX_set_cipher_list(daemon->
io_context,
"RC4-SHA"))
118 SPDYF_DEBUG(
"Couldn't set the desired cipher list");
154 if(1 != (ret = SSL_accept(session->
io_context)))
199 case SSL_ERROR_ZERO_RETURN:
202 case SSL_ERROR_WANT_READ:
203 case SSL_ERROR_WANT_WRITE:
206 case SSL_ERROR_SYSCALL:
235 case SSL_ERROR_ZERO_RETURN:
238 case SSL_ERROR_WANT_READ:
239 case SSL_ERROR_WANT_WRITE:
242 case SSL_ERROR_SYSCALL:
struct SPDY_Daemon * daemon
void SPDYF_openssl_close_session(struct SPDY_Session *session)
void SPDYF_openssl_deinit(struct SPDY_Daemon *daemon)
TCP connection/SPDY session handling.
TLS handling. openssl with NPN is used, but as long as the functions conform to this interface file...
internal functions and macros for the framing layer
void SPDYF_openssl_global_init()
void SPDYF_openssl_global_deinit()
int SPDYF_openssl_new_session(struct SPDY_Session *session)
int SPDYF_openssl_before_write(struct SPDY_Session *session)
#define SPDYF_DEBUG(fmt,...)
int SPDYF_openssl_is_pending(struct SPDY_Session *session)
int SPDYF_openssl_recv(struct SPDY_Session *session, void *buffer, size_t size)
int SPDYF_openssl_init(struct SPDY_Daemon *daemon)
int SPDYF_openssl_after_write(struct SPDY_Session *session, int was_written)
int SPDYF_openssl_send(struct SPDY_Session *session, const void *buffer, size_t size)
static int spdyf_next_protos_advertised_cb(SSL *ssl, const unsigned char **out, unsigned int *outlen, void *arg)