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
From the wolfssl root directory:
```
cd wrapper/CSharp
```
Building the server:
Compile server:
```
mcs wolfSSL_CSharp/wolfSSL.cs wolfSSL_CSharp/X509.cs \
wolfSSL-TLS-Server/wolfSSL-TLS-Server.cs && \
cp wolfSSL_CSharp/wolfSSL.exe ../../certs/server.exe
wolfSSL-TLS-Server/wolfSSL-TLS-Server.cs -OUT:server.exe
```
Building the client:
Compile client:
```
mcs wolfSSL_CSharp/wolfSSL.cs wolfSSL_CSharp/X509.cs \
wolfSSL-TLS-Server/wolfSSL-TLS-Server.cs && \
cp wolfSSL_CSharp/wolfSSL.exe ../../certs/client.exe
wolfSSL-TLS-Client/wolfSSL-TLS-Client.cs -OUT:client.exe
```
### Run the example
In one terminal instance run:
In one terminal instance run the server:
```
cd ../../certs
mono server.exe
```
And in another terminal instance run:
And in another terminal instance run the client:
```
cd ../../certs
mono client.exe
```
### Enabling SNI
To enable SNI, just pass the `-S` argument with the specified hostname:
```
mono client.exe -S hostname
```

View File

@ -88,7 +88,7 @@ public class wolfSSL_TLS_Client
IntPtr sniHostName;
/* 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 buff = new StringBuilder(1024);

View File

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