OLD | NEW |
1 /* | 1 /* |
2 * This file contains prototypes for the public SSL functions. | 2 * This file contains prototypes for the public SSL functions. |
3 * | 3 * |
4 * This Source Code Form is subject to the terms of the Mozilla Public | 4 * This Source Code Form is subject to the terms of the Mozilla Public |
5 * License, v. 2.0. If a copy of the MPL was not distributed with this | 5 * License, v. 2.0. If a copy of the MPL was not distributed with this |
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
7 | 7 |
8 #ifndef __ssl_h_ | 8 #ifndef __ssl_h_ |
9 #define __ssl_h_ | 9 #define __ssl_h_ |
10 | 10 |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 * SSL_SetNextProtoCallback. It also causes a client to advertise NPN and | 201 * SSL_SetNextProtoCallback. It also causes a client to advertise NPN and |
202 * installs a default callback function which selects the first supported | 202 * installs a default callback function which selects the first supported |
203 * protocol in server-preference order. If no matching protocol is found it | 203 * protocol in server-preference order. If no matching protocol is found it |
204 * selects the first supported protocol. | 204 * selects the first supported protocol. |
205 * | 205 * |
206 * Using this function also allows the client to transparently support ALPN. | 206 * Using this function also allows the client to transparently support ALPN. |
207 * The same set of protocols will be advertised via ALPN and, if the server | 207 * The same set of protocols will be advertised via ALPN and, if the server |
208 * uses ALPN to select a protocol, SSL_GetNextProto will return | 208 * uses ALPN to select a protocol, SSL_GetNextProto will return |
209 * SSL_NEXT_PROTO_SELECTED as the state. | 209 * SSL_NEXT_PROTO_SELECTED as the state. |
210 * | 210 * |
| 211 * Since NPN uses the first protocol as the fallback protocol, when sending an |
| 212 * ALPN extension, the first protocol is moved to the end of the list. This |
| 213 * indicates that the fallback protocol is the least preferred. The other |
| 214 * protocols should be in preference order. |
| 215 * |
211 * The supported protocols are specified in |data| in wire-format (8-bit | 216 * The supported protocols are specified in |data| in wire-format (8-bit |
212 * length-prefixed). For example: "\010http/1.1\006spdy/2". */ | 217 * length-prefixed). For example: "\010http/1.1\006spdy/2". */ |
213 SSL_IMPORT SECStatus SSL_SetNextProtoNego(PRFileDesc *fd, | 218 SSL_IMPORT SECStatus SSL_SetNextProtoNego(PRFileDesc *fd, |
214 const unsigned char *data, | 219 const unsigned char *data, |
215 unsigned int length); | 220 unsigned int length); |
216 | 221 |
217 typedef enum SSLNextProtoState { | 222 typedef enum SSLNextProtoState { |
218 SSL_NEXT_PROTO_NO_SUPPORT = 0, /* No peer support */ | 223 SSL_NEXT_PROTO_NO_SUPPORT = 0, /* No peer support */ |
219 SSL_NEXT_PROTO_NEGOTIATED = 1, /* Mutual agreement */ | 224 SSL_NEXT_PROTO_NEGOTIATED = 1, /* Mutual agreement */ |
220 SSL_NEXT_PROTO_NO_OVERLAP = 2, /* No protocol overlap found */ | 225 SSL_NEXT_PROTO_NO_OVERLAP = 2, /* No protocol overlap found */ |
(...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1096 * should continue using the connection. If the application passes a non-zero | 1101 * should continue using the connection. If the application passes a non-zero |
1097 * value for second argument (error), or if SSL_AuthCertificateComplete returns | 1102 * value for second argument (error), or if SSL_AuthCertificateComplete returns |
1098 * anything other than SECSuccess, then the application should close the | 1103 * anything other than SECSuccess, then the application should close the |
1099 * connection. | 1104 * connection. |
1100 */ | 1105 */ |
1101 SSL_IMPORT SECStatus SSL_AuthCertificateComplete(PRFileDesc *fd, | 1106 SSL_IMPORT SECStatus SSL_AuthCertificateComplete(PRFileDesc *fd, |
1102 PRErrorCode error); | 1107 PRErrorCode error); |
1103 SEC_END_PROTOS | 1108 SEC_END_PROTOS |
1104 | 1109 |
1105 #endif /* __ssl_h_ */ | 1110 #endif /* __ssl_h_ */ |
OLD | NEW |