Skip to content

Commit 70fc5c9

Browse files
committed
made the workflow to compile & executes easier, updated the readme also
1 parent 983610e commit 70fc5c9

3 files changed

Lines changed: 17 additions & 13 deletions

File tree

wrapper/CSharp/README.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,40 +42,44 @@ sudo make install
4242

4343
### Build and run the wrapper
4444

45+
From the wolfssl root directory:
46+
4547
```
4648
cd wrapper/CSharp
4749
```
4850

49-
Building the server:
51+
Compile server:
52+
5053
```
5154
mcs wolfSSL_CSharp/wolfSSL.cs wolfSSL_CSharp/X509.cs \
52-
wolfSSL-TLS-Server/wolfSSL-TLS-Server.cs && \
53-
cp wolfSSL_CSharp/wolfSSL.exe ../../certs/server.exe
55+
wolfSSL-TLS-Server/wolfSSL-TLS-Server.cs -OUT:server.exe
5456
```
5557

56-
Building the client:
58+
Compile client:
59+
5760
```
5861
mcs wolfSSL_CSharp/wolfSSL.cs wolfSSL_CSharp/X509.cs \
59-
wolfSSL-TLS-Server/wolfSSL-TLS-Server.cs && \
60-
cp wolfSSL_CSharp/wolfSSL.exe ../../certs/client.exe
62+
wolfSSL-TLS-Client/wolfSSL-TLS-Client.cs -OUT:client.exe
6163
```
6264

6365
### Run the example
6466

65-
In one terminal instance run:
67+
In one terminal instance run the server:
68+
6669
```
67-
cd ../../certs
6870
mono server.exe
6971
```
7072

71-
And in another terminal instance run:
73+
And in another terminal instance run the client:
74+
7275
```
73-
cd ../../certs
7476
mono client.exe
7577
```
7678

7779
### Enabling SNI
80+
7881
To enable SNI, just pass the `-S` argument with the specified hostname:
82+
7983
```
8084
mono client.exe -S hostname
8185
```

wrapper/CSharp/wolfSSL-TLS-Client/wolfSSL-TLS-Client.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public static void Main(string[] args)
8888
IntPtr sniHostName;
8989

9090
/* These paths should be changed for use */
91-
string caCert = @"ca-cert.pem";
91+
string caCert = @"../../certs/ca-cert.pem";
9292
StringBuilder dhparam = new StringBuilder("dh2048.pem");
9393

9494
StringBuilder buff = new StringBuilder(1024);

wrapper/CSharp/wolfSSL-TLS-Server/wolfSSL-TLS-Server.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ public static void Main(string[] args)
8888
IntPtr arg_sni;
8989

9090
/* These paths should be changed for use */
91-
string fileCert = @"server-cert.pem";
92-
string fileKey = @"server-key.pem";
91+
string fileCert = @"../../certs/server-cert.pem";
92+
string fileKey = @"../../certs/server-key.pem";
9393
StringBuilder dhparam = new StringBuilder("dh2048.pem");
9494

9595
StringBuilder buff = new StringBuilder(1024);

0 commit comments

Comments
 (0)