app.hpp (04e438cbad66838724d78ce12f28aff1fb892a63) | app.hpp (81ce609e30274435b4f8c3fc65340c6b6b153b0c) |
---|---|
1#pragma once 2 3#include "http_request.hpp" 4#include "http_server.hpp" 5#include "logging.hpp" 6#include "privileges.hpp" 7#include "routing.hpp" 8#include "utility.hpp" --- 51 unchanged lines hidden (view full) --- 60 } 61 62 template <uint64_t Tag> 63 auto& route(std::string&& rule) 64 { 65 return router.newRuleTagged<Tag>(std::move(rule)); 66 } 67 | 1#pragma once 2 3#include "http_request.hpp" 4#include "http_server.hpp" 5#include "logging.hpp" 6#include "privileges.hpp" 7#include "routing.hpp" 8#include "utility.hpp" --- 51 unchanged lines hidden (view full) --- 60 } 61 62 template <uint64_t Tag> 63 auto& route(std::string&& rule) 64 { 65 return router.newRuleTagged<Tag>(std::move(rule)); 66 } 67 |
68 App& socket(int existing_socket) | 68 App& socket(int existingSocket) |
69 { | 69 { |
70 socketFd = existing_socket; | 70 socketFd = existingSocket; |
71 return *this; 72 } 73 74 App& port(std::uint16_t port) 75 { 76 portUint = port; 77 return *this; 78 } --- 59 unchanged lines hidden (view full) --- 138 return router.getRoutes(root); 139 } 140 std::vector<const std::string*> getRoutes(const std::string& parent) 141 { 142 return router.getRoutes(parent); 143 } 144 145#ifdef BMCWEB_ENABLE_SSL | 71 return *this; 72 } 73 74 App& port(std::uint16_t port) 75 { 76 portUint = port; 77 return *this; 78 } --- 59 unchanged lines hidden (view full) --- 138 return router.getRoutes(root); 139 } 140 std::vector<const std::string*> getRoutes(const std::string& parent) 141 { 142 return router.getRoutes(parent); 143 } 144 145#ifdef BMCWEB_ENABLE_SSL |
146 App& sslFile(const std::string& crt_filename, 147 const std::string& key_filename) | 146 App& sslFile(const std::string& crtFilename, const std::string& keyFilename) |
148 { 149 sslContext = std::make_shared<ssl_context_t>( 150 boost::asio::ssl::context::tls_server); 151 sslContext->set_verify_mode(boost::asio::ssl::verify_peer); | 147 { 148 sslContext = std::make_shared<ssl_context_t>( 149 boost::asio::ssl::context::tls_server); 150 sslContext->set_verify_mode(boost::asio::ssl::verify_peer); |
152 sslContext->use_certificate_file(crt_filename, ssl_context_t::pem); 153 sslContext->use_private_key_file(key_filename, ssl_context_t::pem); | 151 sslContext->use_certificate_file(crtFilename, ssl_context_t::pem); 152 sslContext->use_private_key_file(keyFilename, ssl_context_t::pem); |
154 sslContext->set_options(boost::asio::ssl::context::default_workarounds | 155 boost::asio::ssl::context::no_sslv2 | 156 boost::asio::ssl::context::no_sslv3 | 157 boost::asio::ssl::context::no_tlsv1 | 158 boost::asio::ssl::context::no_tlsv1_1); 159 return *this; 160 } 161 | 153 sslContext->set_options(boost::asio::ssl::context::default_workarounds | 154 boost::asio::ssl::context::no_sslv2 | 155 boost::asio::ssl::context::no_sslv3 | 156 boost::asio::ssl::context::no_tlsv1 | 157 boost::asio::ssl::context::no_tlsv1_1); 158 return *this; 159 } 160 |
162 App& sslFile(const std::string& pem_filename) | 161 App& sslFile(const std::string& pemFilename) |
163 { 164 sslContext = std::make_shared<ssl_context_t>( 165 boost::asio::ssl::context::tls_server); 166 sslContext->set_verify_mode(boost::asio::ssl::verify_peer); | 162 { 163 sslContext = std::make_shared<ssl_context_t>( 164 boost::asio::ssl::context::tls_server); 165 sslContext->set_verify_mode(boost::asio::ssl::verify_peer); |
167 sslContext->load_verify_file(pem_filename); | 166 sslContext->load_verify_file(pemFilename); |
168 sslContext->set_options(boost::asio::ssl::context::default_workarounds | 169 boost::asio::ssl::context::no_sslv2 | 170 boost::asio::ssl::context::no_sslv3 | 171 boost::asio::ssl::context::no_tlsv1 | 172 boost::asio::ssl::context::no_tlsv1_1); 173 return *this; 174 } 175 --- 55 unchanged lines hidden --- | 167 sslContext->set_options(boost::asio::ssl::context::default_workarounds | 168 boost::asio::ssl::context::no_sslv2 | 169 boost::asio::ssl::context::no_sslv3 | 170 boost::asio::ssl::context::no_tlsv1 | 171 boost::asio::ssl::context::no_tlsv1_1); 172 return *this; 173 } 174 --- 55 unchanged lines hidden --- |