Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Create test2.cpp
  • Loading branch information
ihsinme authored Jun 22, 2022
commit 8bf704f490d57ea12ad3d6ed50f9a320a70a8aff
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
namespace std
{
class string{};
}
namespace boost
{
namespace asio
{
namespace ssl
{
typedef int verify_mode;
const int verify_peer = 1;
class rfc2818_verification
{
public:
typedef bool result_type;
explicit rfc2818_verification(const std::string& host) {}
};
class host_name_verification
{
public:
typedef bool result_type;
explicit host_name_verification(const std::string& host) {}
};
class stream
{
public:
stream() {}
void set_verify_mode(verify_mode v) {}
template <typename VerifyCallback>
void set_verify_callback(VerifyCallback callback) {}
};
}
}
}
/*
void goodTest1(boost::asio::ssl::stream sock){ // GOOD
sock.set_verify_mode(boost::asio::ssl::verify_peer);
sock.set_verify_callback(boost::asio::ssl::host_name_verification("host.name"));
}
void goodTest2(boost::asio::ssl::stream sock){ // GOOD
sock.set_verify_mode(boost::asio::ssl::verify_peer);
sock.set_verify_callback(boost::asio::ssl::rfc2818_verification("host.name"));
}
*/
void badTest1(boost::asio::ssl::stream sock){ // BAD
sock.set_verify_mode(boost::asio::ssl::verify_peer);
}