comparison src/event/ngx_event_openssl.h @ 96:ca4f70b3ccc6 NGINX_0_2_2

nginx 0.2.2 *) Feature: the "config errmsg" command of the ngx_http_ssi_module. *) Change: the ngx_http_geo_module variables can be overridden by the "set" directive. *) Feature: the "ssl_protocols" and "ssl_prefer_server_ciphers" directives of the ngx_http_ssl_module and ngx_imap_ssl_module. *) Bugfix: the ngx_http_autoindex_module did not show correctly the long file names; *) Bugfix: the ngx_http_autoindex_module now do not show the files starting by dot. *) Bugfix: if the SSL handshake failed then another connection may be closed too. Thanks to Rob Mueller. *) Bugfix: the export versions of MSIE 5.x could not connect via HTTPS.
author Igor Sysoev <http://sysoev.ru>
date Fri, 30 Sep 2005 00:00:00 +0400
parents 45945fa8b8ba
children 408f195b3482
comparison
equal deleted inserted replaced
95:2f95911bc4b4 96:ca4f70b3ccc6
14 #include <openssl/ssl.h> 14 #include <openssl/ssl.h>
15 #include <openssl/err.h> 15 #include <openssl/err.h>
16 16
17 #if OPENSSL_VERSION_NUMBER >= 0x00907000 17 #if OPENSSL_VERSION_NUMBER >= 0x00907000
18 #include <openssl/engine.h> 18 #include <openssl/engine.h>
19 #define NGX_SSL_ENGINE 1 19 #define NGX_SSL_ENGINE 1
20 #endif 20 #endif
21 21
22 #define NGX_SSL_NAME "OpenSSL" 22 #define NGX_SSL_NAME "OpenSSL"
23 23
24 24
25 typedef struct { 25 typedef struct {
26 SSL *connection; 26 SSL_CTX *ctx;
27 ngx_int_t last; 27 RSA *rsa512_key;
28 ngx_buf_t *buf; 28 ngx_log_t *log;
29 ngx_event_handler_pt saved_read_handler;
30 ngx_event_handler_pt saved_write_handler;
31
32 unsigned buffer:1;
33 unsigned no_rcv_shut:1;
34 unsigned no_send_shut:1;
35 unsigned shutdown_set:1;
36
37 #if (NGX_DEBUG)
38 unsigned handshaked:1;
39 #endif
40 } ngx_ssl_t; 29 } ngx_ssl_t;
41 30
42 31
43 typedef SSL_CTX ngx_ssl_ctx_t; 32 typedef struct {
33 SSL *connection;
34 ngx_int_t last;
35 ngx_buf_t *buf;
36
37 ngx_connection_handler_pt handler;
38
39 ngx_event_handler_pt saved_read_handler;
40 ngx_event_handler_pt saved_write_handler;
41
42 unsigned handshaked:1;
43 unsigned buffer:1;
44 unsigned no_wait_shutdown:1;
45 unsigned no_send_shutdown:1;
46 } ngx_ssl_connection_t;
44 47
45 48
46 #define NGX_SSL_BUFFER 1 49 #define NGX_SSL_SSLv2 2
50 #define NGX_SSL_SSLv3 4
51 #define NGX_SSL_TLSv1 8
47 52
48 #define NGX_SSL_BUFSIZE 16384 53
54 #define NGX_SSL_BUFFER 1
55
56 #define NGX_SSL_BUFSIZE 16384
49 57
50 58
51 ngx_int_t ngx_ssl_init(ngx_log_t *log); 59 ngx_int_t ngx_ssl_init(ngx_log_t *log);
52 ngx_int_t ngx_ssl_create_connection(ngx_ssl_ctx_t *ctx, ngx_connection_t *c, 60 ngx_int_t ngx_ssl_create(ngx_ssl_t *ssl, ngx_uint_t protocols);
61 ngx_int_t ngx_ssl_certificate(ngx_ssl_t *ssl, u_char *cert, u_char *key);
62 ngx_int_t ngx_ssl_generate_rsa512_key(ngx_ssl_t *ssl);
63 ngx_int_t ngx_ssl_create_connection(ngx_ssl_t *ssl, ngx_connection_t *c,
53 ngx_uint_t flags); 64 ngx_uint_t flags);
54 65 ngx_int_t ngx_ssl_handshake(ngx_connection_t *c);
55 #define ngx_ssl_handshake(c) NGX_OK
56
57 ssize_t ngx_ssl_recv(ngx_connection_t *c, u_char *buf, size_t size); 66 ssize_t ngx_ssl_recv(ngx_connection_t *c, u_char *buf, size_t size);
58 ssize_t ngx_ssl_write(ngx_connection_t *c, u_char *data, size_t size); 67 ssize_t ngx_ssl_write(ngx_connection_t *c, u_char *data, size_t size);
59 ngx_chain_t *ngx_ssl_send_chain(ngx_connection_t *c, ngx_chain_t *in, 68 ngx_chain_t *ngx_ssl_send_chain(ngx_connection_t *c, ngx_chain_t *in,
60 off_t limit); 69 off_t limit);
61 ngx_int_t ngx_ssl_shutdown(ngx_connection_t *c); 70 ngx_int_t ngx_ssl_shutdown(ngx_connection_t *c);