#include "net/socket/ssl_connect_job.h"
#include <cstdlib>
#include <memory>
#include <utility>
#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "net/base/connection_endpoint_metadata.h"
#include "net/base/features.h"
#include "net/base/host_port_pair.h"
#include "net/base/net_errors.h"
#include "net/base/trace_constants.h"
#include "net/base/tracing.h"
#include "net/base/url_util.h"
#include "net/cert/x509_util.h"
#include "net/http/http_proxy_connect_job.h"
#include "net/log/net_log_source_type.h"
#include "net/log/net_log_values.h"
#include "net/log/net_log_with_source.h"
#include "net/socket/client_socket_factory.h"
#include "net/socket/client_socket_handle.h"
#include "net/socket/socks_connect_job.h"
#include "net/socket/ssl_client_socket.h"
#include "net/socket/transport_connect_job.h"
#include "net/ssl/ssl_cert_request_info.h"
#include "net/ssl/ssl_connection_status_flags.h"
#include "net/ssl/ssl_info.h"
#include "third_party/abseil-cpp/absl/types/variant.h"
#include "third_party/boringssl/src/include/openssl/pool.h"
#include "third_party/boringssl/src/include/openssl/ssl.h"
namespace net {
namespace {
constexpr base::TimeDelta kSSLHandshakeTimeout(base::Seconds(30));
}
SSLSocketParams::SSLSocketParams(
ConnectJobParams nested_params,
const HostPortPair& host_and_port,
const SSLConfig& ssl_config,
NetworkAnonymizationKey network_anonymization_key)
: … { … }
SSLSocketParams::~SSLSocketParams() = default;
SSLSocketParams::ConnectionType SSLSocketParams::GetConnectionType() const { … }
std::unique_ptr<SSLConnectJob> SSLConnectJob::Factory::Create(
RequestPriority priority,
const SocketTag& socket_tag,
const CommonConnectJobParams* common_connect_job_params,
scoped_refptr<SSLSocketParams> params,
ConnectJob::Delegate* delegate,
const NetLogWithSource* net_log) { … }
SSLConnectJob::SSLConnectJob(
RequestPriority priority,
const SocketTag& socket_tag,
const CommonConnectJobParams* common_connect_job_params,
scoped_refptr<SSLSocketParams> params,
ConnectJob::Delegate* delegate,
const NetLogWithSource* net_log)
: … { … }
SSLConnectJob::~SSLConnectJob() { … }
LoadState SSLConnectJob::GetLoadState() const { … }
bool SSLConnectJob::HasEstablishedConnection() const { … }
void SSLConnectJob::OnConnectJobComplete(int result, ConnectJob* job) { … }
void SSLConnectJob::OnNeedsProxyAuth(
const HttpResponseInfo& response,
HttpAuthController* auth_controller,
base::OnceClosure restart_with_auth_callback,
ConnectJob* job) { … }
ConnectionAttempts SSLConnectJob::GetConnectionAttempts() const { … }
ResolveErrorInfo SSLConnectJob::GetResolveErrorInfo() const { … }
bool SSLConnectJob::IsSSLError() const { … }
scoped_refptr<SSLCertRequestInfo> SSLConnectJob::GetCertRequestInfo() { … }
base::TimeDelta SSLConnectJob::HandshakeTimeoutForTesting() { … }
void SSLConnectJob::OnIOComplete(int result) { … }
int SSLConnectJob::DoLoop(int result) { … }
int SSLConnectJob::DoTransportConnect() { … }
int SSLConnectJob::DoTransportConnectComplete(int result) { … }
int SSLConnectJob::DoSOCKSConnect() { … }
int SSLConnectJob::DoSOCKSConnectComplete(int result) { … }
int SSLConnectJob::DoTunnelConnect() { … }
int SSLConnectJob::DoTunnelConnectComplete(int result) { … }
int SSLConnectJob::DoSSLConnect() { … }
int SSLConnectJob::DoSSLConnectComplete(int result) { … }
SSLConnectJob::State SSLConnectJob::GetInitialState(
SSLSocketParams::ConnectionType connection_type) { … }
int SSLConnectJob::ConnectInternal() { … }
void SSLConnectJob::ResetStateForRestart() { … }
void SSLConnectJob::ChangePriorityInternal(RequestPriority priority) { … }
}