wolfssl/wrapper/CSharp
gasbytes 91cad98d67 1023 <- 1024, changed buffer to textmate 2024-06-27 17:35:43 +02:00
..
wolfSSL-DTLS-PSK-Server - Platform specific function to correctly set the path for the certificates; 2024-06-05 13:28:30 +02:00
wolfSSL-DTLS-Server - Platform specific function to correctly set the path for the certificates; 2024-06-05 13:28:30 +02:00
wolfSSL-Example-IOCallbacks - Platform specific function to correctly set the path for the certificates; 2024-06-05 13:28:30 +02:00
wolfSSL-TLS-Client - Platform specific function to correctly set the path for the certificates; 2024-06-05 13:28:30 +02:00
wolfSSL-TLS-PSK-Client - Platform specific function to correctly set the path for the certificates; 2024-06-05 13:28:30 +02:00
wolfSSL-TLS-PSK-Server - Platform specific function to correctly set the path for the certificates; 2024-06-05 13:28:30 +02:00
wolfSSL-TLS-Server 1023 <- 1024, changed buffer to textmate 2024-06-27 17:35:43 +02:00
wolfSSL-TLS-ServerThreaded - Platform specific function to correctly set the path for the certificates; 2024-06-05 13:28:30 +02:00
wolfSSL_CSharp fixed wolfSSL_SNI_GetFromBuffer 2024-06-27 17:03:05 +02:00
README.md updated the README & haveSNI function 2024-06-04 23:08:56 +02:00
include.am
wolfSSL_CSharp.sln

README.md

wolfSSL CSharp Wrappers

This directory contains the CSharp wrapper for the wolfSSL TLS layer with examples.

  • wolfSSL_CSharp: wolfSSL TLS layer wrappers (library)

Examples:

  • wolfSSL-DTLS-PSK-Server
  • wolfSSL-DTLS-Server
  • wolfSSL-Example-IOCallbacks
  • wolfSSL-TLS-Client
  • wolfSSL-TLS-PSK-Client
  • wolfSSL-TLS-PSK-Server
  • wolfSSL-TLS-Server
  • wolfSSL-TLS-ServerThreaded

Windows

A Visual Studio solution wolfSSL_CSharp.sln is provided. This will allow you to build the wrapper library and examples. It includes the wolfSSL Visual Studio project directly.

Linux (Ubuntu) using mono

Prerequisites for linux:

apt-get update
apt-get upgrade
apt-get install mono-complete

Build wolfSSL and install

./autogen.sh
./configure --enable-wolftpm
make
make check
sudo make install

Build and run the wrapper

From the wolfssl root directory:

cd wrapper/CSharp

Compile server:

mcs wolfSSL_CSharp/wolfSSL.cs wolfSSL_CSharp/X509.cs \
wolfSSL-TLS-Server/wolfSSL-TLS-Server.cs -OUT:server.exe

Compile client:

mcs wolfSSL_CSharp/wolfSSL.cs wolfSSL_CSharp/X509.cs \
wolfSSL-TLS-Client/wolfSSL-TLS-Client.cs -OUT:client.exe

Run the example

In one terminal instance run the server:

mono server.exe

And in another terminal instance run the client:

mono client.exe

Enabling SNI

To enable SNI, just pass the -S argument with the specified hostname to the client:

mono client.exe -S hostname 

And run the server with the -S flag:

mono server.exe -S