Show Pages in chrome://md-settings
[chromium-blink-merge.git] / net / socket / nss_ssl_util.h
blob7b046ffd282aec5c1a066220fbd6580865cfe03b
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // This file is only included in ssl_client_socket_nss.cc and
6 // ssl_server_socket_nss.cc to share common functions of NSS.
8 #ifndef NET_SOCKET_NSS_SSL_UTIL_H_
9 #define NET_SOCKET_NSS_SSL_UTIL_H_
11 #include <prerror.h>
12 #include <prio.h>
14 #include "net/base/net_export.h"
15 #include "net/base/net_log.h"
17 namespace net {
19 class BoundNetLog;
21 // Initalize NSS SSL library.
22 NET_EXPORT void EnsureNSSSSLInit();
24 // Log a failed NSS funcion call.
25 void LogFailedNSSFunction(const BoundNetLog& net_log,
26 const char* function,
27 const char* param);
29 // Map network error code to NSS error code.
30 PRErrorCode MapErrorToNSS(int result);
32 // GetNSSModelSocket returns either NULL, or an NSS socket that can be passed
33 // to |SSL_ImportFD| in order to inherit some default options.
34 PRFileDesc* GetNSSModelSocket();
36 // Map NSS error code to network error code.
37 int MapNSSError(PRErrorCode err);
39 // Creates a NetLog callback for an SSL error.
40 NetLog::ParametersCallback CreateNetLogSSLErrorCallback(int net_error,
41 int ssl_lib_error);
44 } // namespace net
46 #endif // NET_SOCKET_NSS_SSL_UTIL_H_