<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
OpenSSL SSL_SESSSIONS are reference-counted.  This is typical of a<br>
</div>
<div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="PlainText">number of similar sufficiently complex structures for which it makes<br>
more sense to bump a reference counter than to make a copy.<br>
<br>
The SSL_SESSION_free(3), X509_free(), and various other calls just<br>
decrement the reference counter, with the object only actually freed<br>
once the counter reaches 0.<br>
<br>
Various functions (though not all, as documented for each function) that<br>
return such objects to the application increment the refernce counter<br>
(say initially from 1 to 2), and the application is then responsible for<br>
decrementing it.  THe object is finally freed when any internal<br>
reference is released (if that happens last).<br>
---</div>
<div class="PlainText"><br>
<span style="margin:0px;font-size:12pt;font-family:Calibri, Helvetica, sans-serif">Hi Viktor.<span> </span>Thanks for your reply.</span>
<div style="margin:0px;font-size:12pt;font-family:Calibri, Helvetica, sans-serif">
<br>
</div>
<div style="margin:0px;font-size:12pt;font-family:Calibri, Helvetica, sans-serif">
I'm somewhat familiar with the reference count stuff from reading the doc on these (and other) functions. But it sounds like the behavior I'm seeing is expected, and OpenSSL is doing the actual free of the SSL_SESSION when the SSL_CTX is freed. <br>
<br>
Is that accurate?</div>
<div style="margin:0px;font-size:12pt;font-family:Calibri, Helvetica, sans-serif">
<br>
</div>
<div style="margin:0px;font-size:12pt;font-family:Calibri, Helvetica, sans-serif">
Thanks,</div>
<div style="margin:0px;font-size:12pt;font-family:Calibri, Helvetica, sans-serif">
<br>
</div>
<span style="margin:0px;font-size:12pt;font-family:Calibri, Helvetica, sans-serif">Jason</span><br>
</div>
</span></font></div>
</div>
</body>
</html>