
#use wml::openssl-macros area=docs page=SSL_get_current_cipher

<title>Documents, SSL_get_current_cipher(3)</title>

<h1>SSL_get_current_cipher(3)</h1>

#use wml::imp::generic

{:
## What's this? [[s|(<STRONG>[^<].+?)</A>(</STRONG><DD>)|$1$2|sg]]
[[s|<P>\s+<P>|<P>|sg]]
[[s|<P>\s+</|</|sg]]
[[s|<DD>\s*<DT>|<DD>&nbsp;<DT>|sg]]
[[s|<DD>\s*</DL>|<DD>&nbsp;</DL>|sg]]
[[s|\[|&#91;|sg]]
[[s|\]|&#93;|sg]]

<!-- INDEX BEGIN -->

<UL>

	<LI><A HREF="#NAME">NAME</A>
	<LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
	<LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
	<LI><A HREF="#RETURN_VALUES">RETURN VALUES</A>
	<LI><A HREF="#SEE_ALSO">SEE ALSO</A>
</UL>
<!-- INDEX END -->

<HR>
<P>
<HR>
<H1><A NAME="NAME">NAME</A></H1>
<P>
SSL_get_current_cipher, SSL_get_cipher, SSL_get_cipher_name,
SSL_get_cipher_bits, SSL_get_cipher_version - get SSL_CIPHER of a
connection

</P>
<P>
<HR>
<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
<PRE> #include &lt;openssl/ssl.h&gt;
</PRE>
<PRE> SSL_CIPHER *SSL_get_current_cipher(const SSL *ssl);
 \#define SSL_get_cipher(s) \\
                SSL_CIPHER_get_name(SSL_get_current_cipher(s))
 \#define SSL_get_cipher_name(s) \\
                SSL_CIPHER_get_name(SSL_get_current_cipher(s))
 \#define SSL_get_cipher_bits(s,np) \\
                SSL_CIPHER_get_bits(SSL_get_current_cipher(s),np)
 \#define SSL_get_cipher_version(s) \\
                SSL_CIPHER_get_version(SSL_get_current_cipher(s))
</PRE>
<P>
<HR>
<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
<P>
<CODE>SSL_get_current_cipher()</CODE> returns a pointer to an SSL_CIPHER
object containing the description of the actually used cipher of a
connection established with the <STRONG>ssl</STRONG> object.

</P>
<P>
<CODE>SSL_get_cipher()</CODE> and <CODE>SSL_get_cipher_name()</CODE> are
identical macros to obtain the name of the currently used cipher.
<CODE>SSL_get_cipher_bits()</CODE> is a macro to obtain the number of
secret/algorithm bits used and <CODE>SSL_get_cipher_version()</CODE>
returns the protocol name. See <A HREF="../ssl/SSL_CIPHER_get_name.html#">SSL_CIPHER_get_name(3)</A> for more details.

</P>
<P>
<HR>
<H1><A NAME="RETURN_VALUES">RETURN VALUES</A></H1>
<P>
<CODE>SSL_get_current_cipher()</CODE> returns the cipher actually used or
NULL, when no session has been established.

</P>
<P>
<HR>
<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
<P>
<A HREF="../ssl/ssl.html#">ssl(3)</A>, <A HREF="../ssl/SSL_CIPHER_get_name.html#">SSL_CIPHER_get_name(3)</A>



</P>
:}


