xref: /aosp_15_r20/external/cronet/net/ssl/ssl_config_service_defaults.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright 2011 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef NET_SSL_SSL_CONFIG_SERVICE_DEFAULTS_H_
6 #define NET_SSL_SSL_CONFIG_SERVICE_DEFAULTS_H_
7 
8 #include <string_view>
9 
10 #include "net/base/net_export.h"
11 #include "net/ssl/ssl_config_service.h"
12 
13 namespace net {
14 
15 // This SSLConfigService always returns the default SSLConfig settings.  It is
16 // mainly useful for unittests, or for platforms that do not have a native
17 // implementation of SSLConfigService yet.
18 class NET_EXPORT SSLConfigServiceDefaults : public SSLConfigService {
19  public:
20   SSLConfigServiceDefaults();
21 
22   SSLConfigServiceDefaults(const SSLConfigServiceDefaults&) = delete;
23   SSLConfigServiceDefaults& operator=(const SSLConfigServiceDefaults&) = delete;
24 
25   ~SSLConfigServiceDefaults() override;
26 
27   // Returns the default SSL config settings.
28   SSLContextConfig GetSSLContextConfig() override;
29 
30   bool CanShareConnectionWithClientCerts(
31       std::string_view hostname) const override;
32 
33  private:
34   // Default value of prefs.
35   const SSLContextConfig default_config_;
36 };
37 
38 }  // namespace net
39 
40 #endif  // NET_SSL_SSL_CONFIG_SERVICE_DEFAULTS_H_
41