Daniel Pouzzner a3fb5029f8 clean up trailing whitespace and misplaced CRLFs, add missing final newlines, remove stray UTF8 nonprintables (BOMs) and ASCIIfy stray homoglyphs (spaces and apostrophes), guided by expanded coverage in wolfssl-multi-test check-source-text. hai 3 meses
..
wolfSSL-DTLS-PSK-Server 31a6a2bf59 update copyright to 2024 hai 5 meses
wolfSSL-DTLS-Server 31a6a2bf59 update copyright to 2024 hai 5 meses
wolfSSL-Example-IOCallbacks 31a6a2bf59 update copyright to 2024 hai 5 meses
wolfSSL-TLS-Client 31a6a2bf59 update copyright to 2024 hai 5 meses
wolfSSL-TLS-PSK-Client 31a6a2bf59 update copyright to 2024 hai 5 meses
wolfSSL-TLS-PSK-Server 31a6a2bf59 update copyright to 2024 hai 5 meses
wolfSSL-TLS-Server 31a6a2bf59 update copyright to 2024 hai 5 meses
wolfSSL-TLS-ServerThreaded 31a6a2bf59 update copyright to 2024 hai 5 meses
wolfSSL_CSharp 31a6a2bf59 update copyright to 2024 hai 5 meses
README.md a3fb5029f8 clean up trailing whitespace and misplaced CRLFs, add missing final newlines, remove stray UTF8 nonprintables (BOMs) and ASCIIfy stray homoglyphs (spaces and apostrophes), guided by expanded coverage in wolfssl-multi-test check-source-text. hai 3 meses
include.am ea80e9e0ea Add documentation for the CSharp wrapper. hai 1 ano
wolfSSL_CSharp.sln e35c1e5a61 setup of default build config %!s(int64=2) %!d(string=hai) anos

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