1*10e00d17Sschwarze.\" $OpenBSD: SSL_state_string.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $ 26f246b13Sschwarze.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 3f1a3c524Sschwarze.\" 46f246b13Sschwarze.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>. 56f246b13Sschwarze.\" Copyright (c) 2001, 2005 The OpenSSL Project. All rights reserved. 6f1a3c524Sschwarze.\" 76f246b13Sschwarze.\" Redistribution and use in source and binary forms, with or without 86f246b13Sschwarze.\" modification, are permitted provided that the following conditions 96f246b13Sschwarze.\" are met: 106f246b13Sschwarze.\" 116f246b13Sschwarze.\" 1. Redistributions of source code must retain the above copyright 126f246b13Sschwarze.\" notice, this list of conditions and the following disclaimer. 136f246b13Sschwarze.\" 146f246b13Sschwarze.\" 2. Redistributions in binary form must reproduce the above copyright 156f246b13Sschwarze.\" notice, this list of conditions and the following disclaimer in 166f246b13Sschwarze.\" the documentation and/or other materials provided with the 176f246b13Sschwarze.\" distribution. 186f246b13Sschwarze.\" 196f246b13Sschwarze.\" 3. All advertising materials mentioning features or use of this 206f246b13Sschwarze.\" software must display the following acknowledgment: 216f246b13Sschwarze.\" "This product includes software developed by the OpenSSL Project 226f246b13Sschwarze.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" 236f246b13Sschwarze.\" 246f246b13Sschwarze.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 256f246b13Sschwarze.\" endorse or promote products derived from this software without 266f246b13Sschwarze.\" prior written permission. For written permission, please contact 276f246b13Sschwarze.\" openssl-core@openssl.org. 286f246b13Sschwarze.\" 296f246b13Sschwarze.\" 5. Products derived from this software may not be called "OpenSSL" 306f246b13Sschwarze.\" nor may "OpenSSL" appear in their names without prior written 316f246b13Sschwarze.\" permission of the OpenSSL Project. 326f246b13Sschwarze.\" 336f246b13Sschwarze.\" 6. Redistributions of any form whatsoever must retain the following 346f246b13Sschwarze.\" acknowledgment: 356f246b13Sschwarze.\" "This product includes software developed by the OpenSSL Project 366f246b13Sschwarze.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" 376f246b13Sschwarze.\" 386f246b13Sschwarze.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 396f246b13Sschwarze.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 406f246b13Sschwarze.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 416f246b13Sschwarze.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 426f246b13Sschwarze.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 436f246b13Sschwarze.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 446f246b13Sschwarze.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 456f246b13Sschwarze.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 466f246b13Sschwarze.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 476f246b13Sschwarze.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 486f246b13Sschwarze.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 496f246b13Sschwarze.\" OF THE POSSIBILITY OF SUCH DAMAGE. 506f246b13Sschwarze.\" 51*10e00d17Sschwarze.Dd $Mdocdate: March 27 2018 $ 52f1a3c524Sschwarze.Dt SSL_STATE_STRING 3 53f1a3c524Sschwarze.Os 54f1a3c524Sschwarze.Sh NAME 55f1a3c524Sschwarze.Nm SSL_state_string , 56f1a3c524Sschwarze.Nm SSL_state_string_long 57f1a3c524Sschwarze.Nd get textual description of state of an SSL object 58f1a3c524Sschwarze.Sh SYNOPSIS 59f1a3c524Sschwarze.In openssl/ssl.h 60f1a3c524Sschwarze.Ft const char * 61f1a3c524Sschwarze.Fn SSL_state_string "const SSL *ssl" 62f1a3c524Sschwarze.Ft const char * 63f1a3c524Sschwarze.Fn SSL_state_string_long "const SSL *ssl" 64f1a3c524Sschwarze.Sh DESCRIPTION 65f1a3c524Sschwarze.Fn SSL_state_string 66f1a3c524Sschwarzereturns a 6 letter string indicating the current state of the 67f1a3c524Sschwarze.Vt SSL 68f1a3c524Sschwarzeobject 69f1a3c524Sschwarze.Fa ssl . 70f1a3c524Sschwarze.Pp 71f1a3c524Sschwarze.Fn SSL_state_string_long 72f1a3c524Sschwarzereturns a string indicating the current state of the 73f1a3c524Sschwarze.Vt SSL 74f1a3c524Sschwarzeobject 75f1a3c524Sschwarze.Fa ssl . 766f246b13Sschwarze.Pp 77f1a3c524SschwarzeDuring its use, an 78f1a3c524Sschwarze.Vt SSL 79f1a3c524Sschwarzeobject passes several states. 80f1a3c524SschwarzeThe state is internally maintained. 81f1a3c524SschwarzeQuerying the state information is not very informative before or when a 82f1a3c524Sschwarzeconnection has been established. 83f1a3c524SschwarzeIt however can be of significant interest during the handshake. 84f1a3c524Sschwarze.Pp 85f1a3c524SschwarzeWhen using non-blocking sockets, 86f1a3c524Sschwarzethe function call performing the handshake may return with 87f1a3c524Sschwarze.Dv SSL_ERROR_WANT_READ 88f1a3c524Sschwarzeor 89f1a3c524Sschwarze.Dv SSL_ERROR_WANT_WRITE 90f1a3c524Sschwarzecondition, so that 91f1a3c524Sschwarze.Fn SSL_state_string[_long] 92f1a3c524Sschwarzemay be called. 93f1a3c524Sschwarze.Pp 94f1a3c524SschwarzeFor both blocking or non-blocking sockets, 95f1a3c524Sschwarzethe details state information can be used within the 96f1a3c524Sschwarze.Fn info_callback 97f1a3c524Sschwarzefunction set with the 98f1a3c524Sschwarze.Xr SSL_set_info_callback 3 99f1a3c524Sschwarzecall. 100f1a3c524Sschwarze.Sh RETURN VALUES 101f1a3c524SschwarzeDetailed description of possible states to be included later. 102f1a3c524Sschwarze.Sh SEE ALSO 103f1a3c524Sschwarze.Xr ssl 3 , 104f1a3c524Sschwarze.Xr SSL_CTX_set_info_callback 3 1058fba1ec8Sschwarze.Sh HISTORY 1068fba1ec8Sschwarze.Fn SSL_state_string 1078fba1ec8Sschwarzeand 1088fba1ec8Sschwarze.Fn SSL_state_string_long 109*10e00d17Sschwarzefirst appeared in SSLeay 0.6.0 and have been available since 1108fba1ec8Sschwarze.Ox 2.4 . 111