mirror of
https://github.com/SFML/CSFML.git
synced 2026-10-26 21:16:13 +01:00
Add transport layer security to TCP sockets
This commit is contained in:
5 files changed
+232
No files matched your search
@@ -0,0 +1,24 @@
|
||||
#include <CSFML/Network/TcpSocket.h>
|
||||
|
||||
#include <SFML/Network/TcpSocket.hpp>
|
||||
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
TEST_CASE("[Network] sfTcpSocket")
|
||||
{
|
||||
SECTION("sfTlsStatus")
|
||||
{
|
||||
STATIC_CHECK(sfTlsNotConnected == static_cast<int>(sf::TcpSocket::TlsStatus::NotConnected));
|
||||
STATIC_CHECK(sfTlsHandshakeStarted == static_cast<int>(sf::TcpSocket::TlsStatus::HandshakeStarted));
|
||||
STATIC_CHECK(sfTlsHandshakeComplete == static_cast<int>(sf::TcpSocket::TlsStatus::HandshakeComplete));
|
||||
STATIC_CHECK(sfTlsError == static_cast<int>(sf::TcpSocket::TlsStatus::Error));
|
||||
}
|
||||
|
||||
SECTION("TLS on unconnected socket")
|
||||
{
|
||||
sfTcpSocket* socket = sfTcpSocket_create();
|
||||
CHECK(sfTcpSocket_setupTlsClient(socket, "localhost", true) == sfTlsNotConnected);
|
||||
CHECK(sfTcpSocket_getCurrentCiphersuiteName(socket) == nullptr);
|
||||
sfTcpSocket_destroy(socket);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user