1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include
"nsISupports.idl"
8 interface nsIProxyInfo
;
9 [ptr] native PRFileDescStar
(struct PRFileDesc
);
10 native OriginAttributes
(mozilla
::OriginAttributes
);
11 [ref] native const_OriginAttributesRef
(const mozilla
::OriginAttributes
);
14 #include
"mozilla/BasePrincipal.h"
20 [scriptable
, uuid(508d5469
-9e1e
-4a08
-b5b0
-7cfebba1e51a
)]
21 interface nsISocketProvider
: nsISupports
27 * The address family for this socket (PR_AF_INET or PR_AF_INET6).
29 * The origin hostname for this connection.
31 * The origin port for this connection.
33 * If non-null, the proxy hostname for this connection.
35 * The proxy port for this connection.
37 * Control flags that govern this connection (see below.)
39 * An opaque flags for non-standard behavior of the TLS system.
40 * It is unlikely this will need to be set outside of telemetry
41 * studies relating to the TLS implementation.
43 * The resulting PRFileDesc.
44 * @param aSecurityInfo
45 * Any security info that should be associated with aFileDesc. This
46 * object typically implements nsITransportSecurityInfo.
49 void newSocket
(in long aFamily
,
52 in nsIProxyInfo aProxy
,
53 in const_OriginAttributesRef aOriginAttributes
,
54 in unsigned long aFlags
,
55 in unsigned long aTlsFlags
,
56 out PRFileDescStar aFileDesc
,
57 out nsISupports aSecurityInfo
);
62 * This function is called to allow the socket provider to layer a
63 * PRFileDesc on top of another PRFileDesc. For example, SSL via a SOCKS
66 * Parameters are the same as newSocket with the exception of aFileDesc,
67 * which is an in-param instead.
70 void addToSocket
(in long aFamily
,
73 in nsIProxyInfo aProxy
,
74 in const_OriginAttributesRef aOriginAttributes
,
75 in unsigned long aFlags
,
76 in unsigned long aTlsFlags
,
77 in PRFileDescStar aFileDesc
,
78 out nsISupports aSecurityInfo
);
83 * This flag is set if the proxy is to perform hostname resolution instead
84 * of the client. When set, the hostname parameter passed when in this
85 * interface will be used instead of the address structure passed for a
86 * later connect et al. request.
88 const long PROXY_RESOLVES_HOST
= 1 << 0;
91 * When setting this flag, the socket will not apply any
92 * credentials when establishing a connection. For example,
93 * an SSL connection would not send any client-certificates
94 * if this flag is set.
96 const long ANONYMOUS_CONNECT
= 1 << 1;
99 * If set, indicates that the connection was initiated from a source
100 * defined as being private in the sense of Private Browsing. Generally,
101 * there should be no state shared between connections that are private
102 * and those that are not; it is OK for multiple private connections
103 * to share state with each other, and it is OK for multiple non-private
104 * connections to share state with each other.
106 const unsigned long NO_PERMANENT_STORAGE
= 1 << 2;
109 * If set, do not use newer protocol features that might have interop problems
110 * on the Internet. Intended only for use with critical infra like the updater.
113 const unsigned long BE_CONSERVATIVE
= 1 << 3;
116 * This is used for a temporary workaround for a web-compat issue. The flag is
117 * only set on CORS preflight request to allowed sending client certificates
118 * on a connection for an anonymous request.
120 const long ANONYMOUS_CONNECT_ALLOW_CLIENT_CERT
= 1 << 4;