netwerk/socket/nsISSLSocketControl.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/netwerk/socket/nsISSLSocketControl.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,82 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
     1.5 + *
     1.6 + * This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +#include "nsISupports.idl"
    1.11 +
    1.12 +interface nsIInterfaceRequestor;
    1.13 +
    1.14 +%{C++
    1.15 +template<class T> class nsTArray;
    1.16 +class nsCString;
    1.17 +%}
    1.18 +[ref] native nsCStringTArrayRef(nsTArray<nsCString>);
    1.19 +
    1.20 +[scriptable, builtinclass, uuid(4080f700-9c16-4884-8f8d-e28094377084)]
    1.21 +interface nsISSLSocketControl : nsISupports {
    1.22 +    attribute nsIInterfaceRequestor     notificationCallbacks;
    1.23 +
    1.24 +    void proxyStartSSL();
    1.25 +    void StartTLS();
    1.26 +
    1.27 +    /* NPN (Next Protocol Negotiation) is a mechanism for
    1.28 +       negotiating the protocol to be spoken inside the SSL
    1.29 +       tunnel during the SSL handshake. The NPNList is the list
    1.30 +       of offered client side protocols. setNPNList() needs to
    1.31 +       be called before any data is read or written (including the
    1.32 +       handshake to be setup correctly. The server determines the
    1.33 +       priority when multiple matches occur, but if there is no overlap
    1.34 +       the first protocol in the list is used. */
    1.35 +
    1.36 +    [noscript] void setNPNList(in nsCStringTArrayRef aNPNList);
    1.37 +
    1.38 +    /* negotiatedNPN is '' if no NPN list was provided by the client,
    1.39 +     * or if the server did not select any protocol choice from that
    1.40 +     * list. That also includes the case where the server does not
    1.41 +     * implement NPN.
    1.42 +     *
    1.43 +     * If negotiatedNPN is read before NPN has progressed to the point
    1.44 +     * where this information is available NS_ERROR_NOT_CONNECTED is
    1.45 +     * raised.
    1.46 +     */
    1.47 +    readonly attribute ACString negotiatedNPN;
    1.48 +
    1.49 +    /* Determine if a potential SSL connection to hostname:port with
    1.50 +     * a desired NPN negotiated protocol of npnProtocol can use the socket
    1.51 +     * associated with this object instead of making a new one.
    1.52 +     */
    1.53 +    boolean joinConnection(
    1.54 +      in ACString npnProtocol, /* e.g. "spdy/2" */
    1.55 +      in ACString hostname,
    1.56 +      in long port);
    1.57 +
    1.58 +    /* The Key Exchange Algorithm is used when determining whether or
    1.59 +       not to do false start.
    1.60 +       After a handshake is complete it can be read from KEAUsed,
    1.61 +       before a handshake is started it may be set through KEAExpected.
    1.62 +       The values correspond to the SSLKEAType enum in NSS or the
    1.63 +       KEY_EXCHANGE_UNKNOWN constant defined below.
    1.64 +    */
    1.65 +
    1.66 +    [infallible] readonly attribute short KEAUsed;
    1.67 +    [infallible] attribute short KEAExpected;
    1.68 +
    1.69 +    const short KEY_EXCHANGE_UNKNOWN = -1;
    1.70 +
    1.71 +    /*
    1.72 +     * The original flags from the socket provider.
    1.73 +     */
    1.74 +    readonly attribute uint32_t providerFlags;
    1.75 +
    1.76 +    /* These values are defined by TLS. */
    1.77 +    const short SSL_VERSION_3   = 0x0300;
    1.78 +    const short TLS_VERSION_1   = 0x0301;
    1.79 +    const short TLS_VERSION_1_1 = 0x0302;
    1.80 +    const short TLS_VERSION_1_2 = 0x0303;
    1.81 +    const short SSL_VERSION_UNKNOWN = -1;
    1.82 +
    1.83 +    [infallible] readonly attribute short SSLVersionUsed;
    1.84 +};
    1.85 +

mercurial