diff --git a/wrapper/CSharp/README.md b/wrapper/CSharp/README.md index a4f7ab4d7..1d70ba939 100644 --- a/wrapper/CSharp/README.md +++ b/wrapper/CSharp/README.md @@ -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 ``` diff --git a/wrapper/CSharp/wolfSSL-TLS-Client/wolfSSL-TLS-Client.cs b/wrapper/CSharp/wolfSSL-TLS-Client/wolfSSL-TLS-Client.cs index e8e4e9ae6..3086c3cae 100644 --- a/wrapper/CSharp/wolfSSL-TLS-Client/wolfSSL-TLS-Client.cs +++ b/wrapper/CSharp/wolfSSL-TLS-Client/wolfSSL-TLS-Client.cs @@ -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); diff --git a/wrapper/CSharp/wolfSSL-TLS-Server/wolfSSL-TLS-Server.cs b/wrapper/CSharp/wolfSSL-TLS-Server/wolfSSL-TLS-Server.cs index b90453b51..e5b56e91d 100644 --- a/wrapper/CSharp/wolfSSL-TLS-Server/wolfSSL-TLS-Server.cs +++ b/wrapper/CSharp/wolfSSL-TLS-Server/wolfSSL-TLS-Server.cs @@ -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);