Re-sync with internal repository
[hiphop-php.git] / third-party / proxygen / src / proxygen / httpserver / samples / hq / InsecureVerifierDangerousDoNotUseInProduction.h
blobff7a5a221581611e9183eb4d06095952d3716295
1 /*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 * All rights reserved.
5 * This source code is licensed under the BSD-style license found in the
6 * LICENSE file in the root directory of this source tree.
7 */
9 #pragma once
11 #include <fizz/protocol/CertificateVerifier.h>
13 namespace proxygen {
15 // This is an insecure certificate verifier and is not meant to be
16 // used in production. Using it in production would mean that this will
17 // leave everyone insecure.
18 class InsecureVerifierDangerousDoNotUseInProduction
19 : public fizz::CertificateVerifier {
20 public:
21 ~InsecureVerifierDangerousDoNotUseInProduction() override = default;
23 std::shared_ptr<const folly::AsyncTransportCertificate> verify(
24 const std::vector<std::shared_ptr<const fizz::PeerCert>>& certs)
25 const override {
26 return certs.front();
29 std::vector<fizz::Extension> getCertificateRequestExtensions()
30 const override {
31 return std::vector<fizz::Extension>();
34 } // namespace proxygen