Load balancer SSL session hooks

Hello,

I have a question about the SSL hooks in load balancer modules, i.e.:

#if (NGX_SSL)
ngx_event_set_peer_session_pt set_session;
ngx_event_save_peer_session_pt save_session;
#endif

inside struct ngx_peer_connection_s. How are they used? When are they
called? I implemented them “blindly” for upstream_fair as I don’t
remember ever seeing them called. They look like support for https
proxying but I can’t see the bigger picture.

Best regards,
Grzegorz N.

On Sun, Dec 02, 2007 at 11:45:20AM +0100, Grzegorz N. wrote:

proxying but I can’t see the bigger picture.
set_session is called before handshaking to upstream, it sets saved
previously SSL peer session for new connection.

save_session is called just after handshake has been done, it
saves/replaces
new SSL session for a peer.

On Sun, Dec 02, 2007 at 01:57:04PM +0300, Igor S. wrote:

called? I implemented them “blindly” for upstream_fair as I don’t
remember ever seeing them called. They look like support for https
proxying but I can’t see the bigger picture.

set_session is called before handshaking to upstream, it sets saved
previously SSL peer session for new connection.

save_session is called just after handshake has been done, it saves/replaces
new SSL session for a peer.

They are used for SSL session resumption. You may read about this here:
http://www.linuxjournal.com/article/5487