-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtlsProtocol.cpp
41 lines (32 loc) · 1.01 KB
/
tlsProtocol.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*#include <botan/tls_client.h>
#include <botan/tls_callbacks.h>
#include <botan/tls_session_manager.h>
#include <botan/tls_policy.h>
#include <botan/auto_rng.h>
#include <botan/certstor.h>
#include <botan/certstor_system.h>
class Callbacks : public Botan::TLS::Callbacks
{
// ...
};
class Client_Credentials : public Botan::Credentials_Manager
{
// ...
};
void protocol_main()
{
Callbacks* callbacks;
Botan::AutoSeeded_RNG rng;
Botan::TLS::Session_Manager_In_Memory session_mgr(rng);
Client_Credentials creds;
Botan::TLS::Policy policy;
Botan::TLS::Client client(*callbacks, session_mgr, creds, policy, rng,
Botan::TLS::Server_Information("example.com", 443),
Botan::TLS::Protocol_Version::TLS_V12);
Botan::TLS::Strict_Policy new_policy;
char serverUrl[] = "example.com";
Botan::TLS::Client new_client(*callbacks, session_mgr, creds, new_policy, rng,
Botan::TLS::Server_Information(serverUrl, 443),
Botan::TLS::Protocol_Version::TLS_V12);
}
*/