[#SSL_CTX_add_server_custom_ext]
= SSL&lowbar;CTX&lowbar;add&lowbar;server&lowbar;custom&lowbar;ext
:mrdocs:

Register a custom TLS extension handler for the server role on an SSL context&period;

== Synopsis

Declared in `&lt;openssl&sol;ssl&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
SSL&lowbar;CTX&lowbar;add&lowbar;server&lowbar;custom&lowbar;ext(
    xref:SSL_CTX.adoc[SSL&lowbar;CTX]* ctx,
    unsigned int ext&lowbar;type,
    xref:custom_ext_add_cb.adoc[custom&lowbar;ext&lowbar;add&lowbar;cb] add&lowbar;cb,
    xref:custom_ext_free_cb.adoc[custom&lowbar;ext&lowbar;free&lowbar;cb] free&lowbar;cb,
    void* add&lowbar;arg,
    xref:custom_ext_parse_cb.adoc[custom&lowbar;ext&lowbar;parse&lowbar;cb] parse&lowbar;cb,
    void* parse&lowbar;arg);
----

== Return Value

1 on success, or 0 on failure&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *ctx*
| Server SSL context that sends or receives the extension&period;
| *ext&lowbar;type*
| Extension type code (must not collide with built&hyphen;in handlers)&period;
| *add&lowbar;cb*
| Callback that constructs extension data to send, or NULL&period;
| *free&lowbar;cb*
| Callback that frees data produced by `add&lowbar;cb,` or NULL&period;
| *add&lowbar;arg*
| Opaque pointer passed to `add&lowbar;cb` &sol; `free&lowbar;cb&period;`
| *parse&lowbar;cb*
| Callback that parses a received extension, or NULL&period;
| *parse&lowbar;arg*
| Opaque pointer passed to `parse&lowbar;cb&period;`
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
