netwerk/socket/nsISSLSocketControl.idl

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

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

mercurial