# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

folly_add_library(
  NAME openssl
  EXPORTED_DEPS
    folly_io_async_ssl_openssl_utils
    folly_io_async_ssl_ssl_errors
)

folly_add_library(
  NAME basic_transport_certificate
  HEADERS
    BasicTransportCertificate.h
  EXPORTED_DEPS
    folly_io_async_ssl_openssl_transport_certificate
)

folly_add_library(
  NAME openssl_transport_certificate
  HEADERS
    OpenSSLTransportCertificate.h
  EXPORTED_DEPS
    folly_io_async_async_transport_certificate
    folly_portability_openssl
    folly_ssl_openssl_ptr_types
)

folly_add_library(
  NAME openssl_utils
  SRCS
    OpenSSLUtils.cpp
  HEADERS
    OpenSSLUtils.h
  DEPS
    folly_portability_unistd
    folly_scope_guard
    folly_ssl_detail_openssl_session
  EXPORTED_DEPS
    folly_io_async_async_socket_exception
    folly_net_network_socket
    folly_portability_openssl
    folly_portability_sockets
    folly_range
    folly_ssl_openssl_ptr_types
    folly_ssl_ssl_session
  EXTERNAL_DEPS
    ${GLOG_LIBRARIES}
)

folly_add_library(
  NAME ssl_errors
  SRCS
    SSLErrors.cpp
  HEADERS
    SSLErrors.h
  DEPS
    folly_portability_openssl
    folly_range
  EXPORTED_DEPS
    folly_io_async_async_socket_exception
)

folly_add_library(
  NAME tls_definitions
  HEADERS
    TLSDefinitions.h
  EXPORTED_DEPS
    folly_io_iobuf
)
