Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "nsISupports.idl"
9 interface nsIInterfaceRequestor;
11 %{C++
12 template<class T> class nsTArray;
13 class nsCString;
14 %}
15 [ref] native nsCStringTArrayRef(nsTArray<nsCString>);
17 [scriptable, builtinclass, uuid(4080f700-9c16-4884-8f8d-e28094377084)]
18 interface nsISSLSocketControl : nsISupports {
19 attribute nsIInterfaceRequestor notificationCallbacks;
21 void proxyStartSSL();
22 void StartTLS();
24 /* NPN (Next Protocol Negotiation) is a mechanism for
25 negotiating the protocol to be spoken inside the SSL
26 tunnel during the SSL handshake. The NPNList is the list
27 of offered client side protocols. setNPNList() needs to
28 be called before any data is read or written (including the
29 handshake to be setup correctly. The server determines the
30 priority when multiple matches occur, but if there is no overlap
31 the first protocol in the list is used. */
33 [noscript] void setNPNList(in nsCStringTArrayRef aNPNList);
35 /* negotiatedNPN is '' if no NPN list was provided by the client,
36 * or if the server did not select any protocol choice from that
37 * list. That also includes the case where the server does not
38 * implement NPN.
39 *
40 * If negotiatedNPN is read before NPN has progressed to the point
41 * where this information is available NS_ERROR_NOT_CONNECTED is
42 * raised.
43 */
44 readonly attribute ACString negotiatedNPN;
46 /* Determine if a potential SSL connection to hostname:port with
47 * a desired NPN negotiated protocol of npnProtocol can use the socket
48 * associated with this object instead of making a new one.
49 */
50 boolean joinConnection(
51 in ACString npnProtocol, /* e.g. "spdy/2" */
52 in ACString hostname,
53 in long port);
55 /* The Key Exchange Algorithm is used when determining whether or
56 not to do false start.
57 After a handshake is complete it can be read from KEAUsed,
58 before a handshake is started it may be set through KEAExpected.
59 The values correspond to the SSLKEAType enum in NSS or the
60 KEY_EXCHANGE_UNKNOWN constant defined below.
61 */
63 [infallible] readonly attribute short KEAUsed;
64 [infallible] attribute short KEAExpected;
66 const short KEY_EXCHANGE_UNKNOWN = -1;
68 /*
69 * The original flags from the socket provider.
70 */
71 readonly attribute uint32_t providerFlags;
73 /* These values are defined by TLS. */
74 const short SSL_VERSION_3 = 0x0300;
75 const short TLS_VERSION_1 = 0x0301;
76 const short TLS_VERSION_1_1 = 0x0302;
77 const short TLS_VERSION_1_2 = 0x0303;
78 const short SSL_VERSION_UNKNOWN = -1;
80 [infallible] readonly attribute short SSLVersionUsed;
81 };