2000-09-22 08:42:20 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
2012-05-21 15:12:37 +04:00
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2000-09-22 08:42:20 +04:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
2001-05-18 04:02:46 +04:00
|
|
|
interface nsIInterfaceRequestor;
|
2014-08-08 00:32:00 +04:00
|
|
|
interface nsIX509Cert;
|
2001-05-18 04:02:46 +04:00
|
|
|
|
2011-12-13 19:55:50 +04:00
|
|
|
%{C++
|
2016-07-20 18:29:36 +03:00
|
|
|
#include "nsTArrayForwardDeclare.h"
|
2011-12-13 19:55:50 +04:00
|
|
|
class nsCString;
|
|
|
|
%}
|
|
|
|
[ref] native nsCStringTArrayRef(nsTArray<nsCString>);
|
|
|
|
|
2015-04-09 18:31:59 +03:00
|
|
|
[scriptable, builtinclass, uuid(418265c8-654e-4fbb-ba62-4eed27de1f03)]
|
2001-01-19 04:12:10 +03:00
|
|
|
interface nsISSLSocketControl : nsISupports {
|
2001-05-18 04:02:46 +04:00
|
|
|
attribute nsIInterfaceRequestor notificationCallbacks;
|
|
|
|
|
2002-08-15 03:43:28 +04:00
|
|
|
void proxyStartSSL();
|
|
|
|
void StartTLS();
|
2011-12-13 19:55:50 +04:00
|
|
|
|
|
|
|
/* NPN (Next Protocol Negotiation) is a mechanism for
|
|
|
|
negotiating the protocol to be spoken inside the SSL
|
|
|
|
tunnel during the SSL handshake. The NPNList is the list
|
|
|
|
of offered client side protocols. setNPNList() needs to
|
|
|
|
be called before any data is read or written (including the
|
2013-05-29 04:09:22 +04:00
|
|
|
handshake to be setup correctly. The server determines the
|
|
|
|
priority when multiple matches occur, but if there is no overlap
|
|
|
|
the first protocol in the list is used. */
|
2011-12-13 19:55:50 +04:00
|
|
|
|
|
|
|
[noscript] void setNPNList(in nsCStringTArrayRef aNPNList);
|
|
|
|
|
|
|
|
/* negotiatedNPN is '' if no NPN list was provided by the client,
|
|
|
|
* or if the server did not select any protocol choice from that
|
|
|
|
* list. That also includes the case where the server does not
|
|
|
|
* implement NPN.
|
|
|
|
*
|
|
|
|
* If negotiatedNPN is read before NPN has progressed to the point
|
|
|
|
* where this information is available NS_ERROR_NOT_CONNECTED is
|
|
|
|
* raised.
|
|
|
|
*/
|
|
|
|
readonly attribute ACString negotiatedNPN;
|
|
|
|
|
2016-08-19 12:01:00 +03:00
|
|
|
/* For 0RTT we need to know the alpn protocol selected for the last tls
|
|
|
|
* session. This function will return a value if applicable or an error
|
|
|
|
* NS_ERROR_NOT_AVAILABLE.
|
|
|
|
*/
|
|
|
|
ACString getAlpnEarlySelection();
|
|
|
|
|
|
|
|
/* If 0RTT handshake was applied and some data has been sent, as soon as
|
|
|
|
* the handshake finishes this attribute will be set to appropriate value.
|
|
|
|
*/
|
|
|
|
readonly attribute bool earlyDataAccepted;
|
|
|
|
|
|
|
|
/* When 0RTT is performed, PR_Write will not drive the handshake forward.
|
|
|
|
* It must be forced by calling this function.
|
|
|
|
*/
|
|
|
|
void driveHandshake();
|
|
|
|
|
2011-12-13 19:55:50 +04:00
|
|
|
/* Determine if a potential SSL connection to hostname:port with
|
|
|
|
* a desired NPN negotiated protocol of npnProtocol can use the socket
|
|
|
|
* associated with this object instead of making a new one.
|
|
|
|
*/
|
|
|
|
boolean joinConnection(
|
|
|
|
in ACString npnProtocol, /* e.g. "spdy/2" */
|
|
|
|
in ACString hostname,
|
|
|
|
in long port);
|
2012-06-30 18:34:17 +04:00
|
|
|
|
2014-08-21 00:30:16 +04:00
|
|
|
/* Determine if existing connection should be trusted to convey information about
|
|
|
|
* a hostname.
|
|
|
|
*/
|
|
|
|
boolean isAcceptableForHost(in ACString hostname);
|
|
|
|
|
2013-11-26 03:12:40 +04:00
|
|
|
/* The Key Exchange Algorithm is used when determining whether or
|
2014-12-10 21:13:18 +03:00
|
|
|
not HTTP/2 can be used.
|
2014-05-07 01:22:25 +04:00
|
|
|
|
2014-12-10 21:13:18 +03:00
|
|
|
After a handshake is complete it can be read from KEAUsed.
|
2013-11-26 03:12:40 +04:00
|
|
|
The values correspond to the SSLKEAType enum in NSS or the
|
|
|
|
KEY_EXCHANGE_UNKNOWN constant defined below.
|
2014-05-07 01:22:25 +04:00
|
|
|
|
|
|
|
KEAKeyBits is the size/security-level used for the KEA.
|
2013-06-29 00:58:28 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
[infallible] readonly attribute short KEAUsed;
|
2014-05-07 01:22:25 +04:00
|
|
|
[infallible] readonly attribute unsigned long KEAKeyBits;
|
2013-06-29 00:58:28 +04:00
|
|
|
|
|
|
|
const short KEY_EXCHANGE_UNKNOWN = -1;
|
|
|
|
|
2012-06-30 18:34:17 +04:00
|
|
|
/*
|
|
|
|
* The original flags from the socket provider.
|
|
|
|
*/
|
|
|
|
readonly attribute uint32_t providerFlags;
|
2013-10-10 04:21:48 +04:00
|
|
|
|
|
|
|
/* These values are defined by TLS. */
|
|
|
|
const short SSL_VERSION_3 = 0x0300;
|
|
|
|
const short TLS_VERSION_1 = 0x0301;
|
|
|
|
const short TLS_VERSION_1_1 = 0x0302;
|
|
|
|
const short TLS_VERSION_1_2 = 0x0303;
|
2016-04-04 22:21:19 +03:00
|
|
|
const short TLS_VERSION_1_3 = 0x0304;
|
2013-10-10 04:21:48 +04:00
|
|
|
const short SSL_VERSION_UNKNOWN = -1;
|
|
|
|
|
|
|
|
[infallible] readonly attribute short SSLVersionUsed;
|
2014-08-15 17:39:53 +04:00
|
|
|
[infallible] readonly attribute short SSLVersionOffered;
|
2014-08-05 00:54:10 +04:00
|
|
|
|
|
|
|
/* These values match the NSS defined values in sslt.h */
|
|
|
|
const short SSL_MAC_UNKNOWN = -1;
|
|
|
|
const short SSL_MAC_NULL = 0;
|
|
|
|
const short SSL_MAC_MD5 = 1;
|
|
|
|
const short SSL_MAC_SHA = 2;
|
|
|
|
const short SSL_HMAC_MD5 = 3;
|
|
|
|
const short SSL_HMAC_SHA = 4;
|
|
|
|
const short SSL_HMAC_SHA256 = 5;
|
|
|
|
const short SSL_MAC_AEAD = 6;
|
|
|
|
|
|
|
|
[infallible] readonly attribute short MACAlgorithmUsed;
|
2014-08-08 00:32:00 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* If set before the server requests a client cert (assuming it does so at
|
|
|
|
* all), then this cert will be presented to the server, instead of asking
|
|
|
|
* the user or searching the set of rememebered user cert decisions.
|
|
|
|
*/
|
|
|
|
attribute nsIX509Cert clientCert;
|
2014-08-21 00:30:16 +04:00
|
|
|
|
|
|
|
/**
|
2015-04-09 18:31:59 +03:00
|
|
|
* bypassAuthentication is true if the server certificate checks are
|
2014-08-21 00:30:16 +04:00
|
|
|
* not be enforced. This is to enable non-secure transport over TLS.
|
|
|
|
*/
|
2015-04-09 18:31:59 +03:00
|
|
|
[infallible] readonly attribute boolean bypassAuthentication;
|
2014-08-21 00:30:16 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* failedVerification is true if any enforced certificate checks have failed.
|
|
|
|
* Connections that have not yet tried to verify, have verifications bypassed,
|
|
|
|
* or are using acceptable exceptions will all return false.
|
|
|
|
*/
|
|
|
|
[infallible] readonly attribute boolean failedVerification;
|
2000-09-22 08:42:20 +04:00
|
|
|
};
|
|
|
|
|