made the workflow to compile & executes easier, updated the readme also

This commit is contained in:
gasbytes
2024-06-04 19:13:51 +02:00
parent 983610ed68
commit 70fc5c97fb
3 changed files with 17 additions and 13 deletions

View File

@ -42,40 +42,44 @@ sudo make install
### Build and run the wrapper ### Build and run the wrapper
From the wolfssl root directory:
``` ```
cd wrapper/CSharp cd wrapper/CSharp
``` ```
Building the server: Compile server:
``` ```
mcs wolfSSL_CSharp/wolfSSL.cs wolfSSL_CSharp/X509.cs \ mcs wolfSSL_CSharp/wolfSSL.cs wolfSSL_CSharp/X509.cs \
wolfSSL-TLS-Server/wolfSSL-TLS-Server.cs && \ wolfSSL-TLS-Server/wolfSSL-TLS-Server.cs -OUT:server.exe
cp wolfSSL_CSharp/wolfSSL.exe ../../certs/server.exe
``` ```
Building the client: Compile client:
``` ```
mcs wolfSSL_CSharp/wolfSSL.cs wolfSSL_CSharp/X509.cs \ mcs wolfSSL_CSharp/wolfSSL.cs wolfSSL_CSharp/X509.cs \
wolfSSL-TLS-Server/wolfSSL-TLS-Server.cs && \ wolfSSL-TLS-Client/wolfSSL-TLS-Client.cs -OUT:client.exe
cp wolfSSL_CSharp/wolfSSL.exe ../../certs/client.exe
``` ```
### Run the example ### Run the example
In one terminal instance run: In one terminal instance run the server:
``` ```
cd ../../certs
mono server.exe mono server.exe
``` ```
And in another terminal instance run: And in another terminal instance run the client:
``` ```
cd ../../certs
mono client.exe mono client.exe
``` ```
### Enabling SNI ### Enabling SNI
To enable SNI, just pass the `-S` argument with the specified hostname: To enable SNI, just pass the `-S` argument with the specified hostname:
``` ```
mono client.exe -S hostname mono client.exe -S hostname
``` ```

View File

@ -88,7 +88,7 @@ public class wolfSSL_TLS_Client
IntPtr sniHostName; IntPtr sniHostName;
/* These paths should be changed for use */ /* These paths should be changed for use */
string caCert = @"ca-cert.pem"; string caCert = @"../../certs/ca-cert.pem";
StringBuilder dhparam = new StringBuilder("dh2048.pem"); StringBuilder dhparam = new StringBuilder("dh2048.pem");
StringBuilder buff = new StringBuilder(1024); StringBuilder buff = new StringBuilder(1024);

View File

@ -88,8 +88,8 @@ public class wolfSSL_TLS_CSHarp
IntPtr arg_sni; IntPtr arg_sni;
/* These paths should be changed for use */ /* These paths should be changed for use */
string fileCert = @"server-cert.pem"; string fileCert = @"../../certs/server-cert.pem";
string fileKey = @"server-key.pem"; string fileKey = @"../../certs/server-key.pem";
StringBuilder dhparam = new StringBuilder("dh2048.pem"); StringBuilder dhparam = new StringBuilder("dh2048.pem");
StringBuilder buff = new StringBuilder(1024); StringBuilder buff = new StringBuilder(1024);