Added SSL connection
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
|
using System.Net.Security;
|
||||||
using System.Net.Sockets;
|
using System.Net.Sockets;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
@@ -26,7 +27,7 @@ namespace ErgometerLibrary
|
|||||||
client.GetStream().Flush();
|
client.GetStream().Flush();
|
||||||
*/
|
*/
|
||||||
|
|
||||||
StreamWriter wr = new StreamWriter(client.GetStream(), Encoding.Unicode);
|
StreamWriter wr = new StreamWriter(new SslStream(client.GetStream(), false), Encoding.Unicode);
|
||||||
wr.WriteLine(command);
|
wr.WriteLine(command);
|
||||||
Console.WriteLine("sent " + command);
|
Console.WriteLine("sent " + command);
|
||||||
wr.Flush();
|
wr.Flush();
|
||||||
@@ -56,7 +57,7 @@ namespace ErgometerLibrary
|
|||||||
return response;
|
return response;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
StreamReader rd = new StreamReader(client.GetStream(), Encoding.Unicode);
|
StreamReader rd = new StreamReader(new SslStream(client.GetStream(), false), Encoding.Unicode);
|
||||||
string str = rd.ReadLine();
|
string str = rd.ReadLine();
|
||||||
Console.WriteLine("rec " + str);
|
Console.WriteLine("rec " + str);
|
||||||
return str;
|
return str;
|
||||||
|
|||||||
Reference in New Issue
Block a user