1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-15 04:42:04 +00:00
srs/trunk/src/app/srs_app_rtc_dtls.hpp

57 lines
1.6 KiB
C++
Raw Normal View History

2020-03-06 15:01:48 +00:00
/**
* The MIT License (MIT)
*
* Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
2020-05-11 04:07:55 +00:00
#ifndef SRS_APP_RTC_DTLS_HPP
#define SRS_APP_RTC_DTLS_HPP
2020-03-06 15:01:48 +00:00
#include <srs_core.hpp>
#include <string>
2020-04-03 07:03:09 +00:00
class SrsRequest;
2020-03-06 15:01:48 +00:00
#include <openssl/ssl.h>
class SrsDtls
{
private:
static SrsDtls* _instance;
private:
std::string fingerprint;
X509* dtls_cert;
EVP_PKEY* dtls_pkey;
EC_KEY* eckey;
2020-03-06 15:01:48 +00:00
private:
SrsDtls();
virtual ~SrsDtls();
2020-04-03 07:03:09 +00:00
public:
2020-04-26 08:12:23 +00:00
srs_error_t init(SrsRequest* r);
2020-03-06 15:01:48 +00:00
public:
static SrsDtls* instance();
2020-06-24 10:03:09 +00:00
SSL_CTX* build_dtls_ctx();
2020-03-06 15:01:48 +00:00
public:
std::string get_fingerprint() const;
2020-03-06 15:01:48 +00:00
};
#endif