mirror of
https://github.com/curl/curl.git
synced 2024-12-09 06:30:06 +08:00
472f1cbe7e
Next Protocol Negotiation is a TLS extension that was created and used for agreeing to use the SPDY protocol (the precursor to HTTP/2) for HTTPS. In the early days of HTTP/2, before the spec was finalized and shipped, the protocol could be enabled using this extension with some servers. curl supports the NPN extension with some TLS backends since then, with a command line option `--npn` and in libcurl with `CURLOPT_SSL_ENABLE_NPN`. HTTP/2 proper is made to use the ALPN (Application-Layer Protocol Negotiation) extension and the NPN extension has no purposes anymore. The HTTP/2 spec was published in May 2015. Today, use of NPN in the wild should be extremely rare and most likely totally extinct. Chrome removed NPN support in Chrome 51, shipped in June 2016. Removed in Firefox 53, April 2017. Closes #9307
60 lines
2.1 KiB
Groff
60 lines
2.1 KiB
Groff
.\" **************************************************************************
|
|
.\" * _ _ ____ _
|
|
.\" * Project ___| | | | _ \| |
|
|
.\" * / __| | | | |_) | |
|
|
.\" * | (__| |_| | _ <| |___
|
|
.\" * \___|\___/|_| \_\_____|
|
|
.\" *
|
|
.\" * Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
|
|
.\" *
|
|
.\" * This software is licensed as described in the file COPYING, which
|
|
.\" * you should have received as part of this distribution. The terms
|
|
.\" * are also available at https://curl.se/docs/copyright.html.
|
|
.\" *
|
|
.\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
|
.\" * copies of the Software, and permit persons to whom the Software is
|
|
.\" * furnished to do so, under the terms of the COPYING file.
|
|
.\" *
|
|
.\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
.\" * KIND, either express or implied.
|
|
.\" *
|
|
.\" * SPDX-License-Identifier: curl
|
|
.\" *
|
|
.\" **************************************************************************
|
|
.\"
|
|
.TH CURLOPT_SSL_ENABLE_NPN 3 "19 Jun 2014" "libcurl 7.37.0" "curl_easy_setopt options"
|
|
.SH NAME
|
|
CURLOPT_SSL_ENABLE_NPN \- use NPN
|
|
.SH SYNOPSIS
|
|
.nf
|
|
#include <curl/curl.h>
|
|
|
|
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SSL_ENABLE_NPN, long npn);
|
|
.fi
|
|
.SH DESCRIPTION
|
|
Deprecated in 7.86.0. Setting this option has no function.
|
|
|
|
Pass a long as parameter, 0 or 1 where 1 is for enable and 0 for disable. This
|
|
option enables/disables NPN in the SSL handshake (if the SSL backend libcurl
|
|
is built to use supports it), which can be used to negotiate http2.
|
|
.SH DEFAULT
|
|
1, enabled
|
|
.SH PROTOCOLS
|
|
HTTP
|
|
.SH EXAMPLE
|
|
.nf
|
|
CURL *curl = curl_easy_init();
|
|
if(curl) {
|
|
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
|
|
curl_easy_setopt(curl, CURLOPT_SSL_ENABLE_NPN, 1L);
|
|
ret = curl_easy_perform(curl);
|
|
curl_easy_cleanup(curl);
|
|
}
|
|
.fi
|
|
.SH AVAILABILITY
|
|
Added in 7.36.0. Deprecated in 7.86.0.
|
|
.SH RETURN VALUE
|
|
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
|
.SH "SEE ALSO"
|
|
.BR CURLOPT_SSL_ENABLE_ALPN "(3), " CURLOPT_SSL_OPTIONS "(3), "
|