.\" $OpenBSD: SSL_SESSION_new.3,v 1.1 2016/12/06 18:40:31 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd $Mdocdate: December 6 2016 $ .Dt SSL_SESSION_NEW 3 .Os .Sh NAME .Nm SSL_SESSION_new .Nd construct a new SSL_SESSION object .Sh SYNOPSIS .In openssl/ssl.h .Ft SSL_SESSION * .Fn SSL_SESSION_new void .Sh DESCRIPTION .Fn SSL_SESSION_new allocates and initializes an new .Vt SSL_SESSION object. The reference count is set to 1, the time to the current time, and the timeout to five minutes. .Pp When the object is no longer needed, it can be destructed with .Xr SSL_SESSION_free 3 . .Pp .Fn SSL_SESSION_new is used internally, for example by .Xr SSL_connect 3 . .Sh RETURN VALUES .Fn SSL_SESSION_new returns the new .Vt SSL_SESSION object or .Dv NULL if insufficient memory is available. .Pp After failure, .Xr ERR_get_error 3 returns .Dv ERR_R_MALLOC_FAILURE . .Sh SEE ALSO .Xr d2i_SSL_SESSION 3 , .Xr PEM_read_SSL_SESSION 3 , .Xr SSL_connect 3 , .Xr SSL_CTX_add_session 3 , .Xr SSL_get_session 3 , .Xr SSL_SESSION_free 3 , .Xr SSL_SESSION_get_ex_new_index 3 , .Xr SSL_SESSION_get_time 3 , .Xr SSL_set_session 3