You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+53-1Lines changed: 53 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
# IpcServiceFramework
4
4
5
-
A .NET Core lightweight inter-process communication framework allowing invoking a service via named pipeline and/or TCP (in a similar way as WCF, which is currently unavailable for .NET Core).
5
+
A .NET Core lightweight inter-process communication framework allowing invoking a service via named pipeline and/or TCP (in a similar way as WCF, which is currently unavailable for .NET Core). Secure communication over SSL is also supported.
6
6
7
7
Support using primitive or complexe types in service contract.
__Welcome to raise any issue or even provide any suggestion/PR to participate this project!__
112
+
113
+
## Security
114
+
115
+
If you are running IPC channels over TCP on an untrusted network, you should consider using SSL. IpcServiceFramework supports SSL on TCP clients and hosts.
116
+
117
+
### Generate certificates for testing
118
+
119
+
**Do not use the provided certificates in the project folder.** These are used for example purposes only.
120
+
121
+
For testing, you can generate a self-signed certificate using the following openssl command:
See the ConsoleServer and WebServer projects for more complete examples.
143
+
144
+
Note: for security and maintenance reasons, we do not recommend that you hard-code the certificate password. It should instead be stored in the application configuration file so that it can be easily changed.
145
+
146
+
### Safe usage
147
+
148
+
SSL/TLS is only secure if you use it properly. Here are some tips:
149
+
150
+
* For production purposes, use a proper server certificate, signed by a real certificate authority (CA) or your organisation's internal CA. Do not use self-signed certificates in production.
151
+
* Do not use custom certificate validation callbacks on the client. They are hard to implement correctly and tend to result in security issues.
152
+
* Unconditionally returning true in a validation callback provides no security whatsoever against an attacker who can perform man-in-the-middle attacks.
153
+
* The callback used in the ConsoleServer project example is not secure. It checks for the correct certificate by hash but does not check its validity, expiry date, revocation status, or other important security properties.
154
+
155
+
### Client certificates
156
+
157
+
Client certificates are not currently supported.
158
+
159
+
## Stream translators
160
+
161
+
If you want to process the binary data after serialisation or before deserialisation, for example to add a custom handshake when the connection begins, you can do so using a stream translator. Host and client classes allow you to pass a `Func<Stream, Stream>` stream translation callback in their constructors, which can be used to "wrap" a custom stream around the network stream. This is supported on TCP communications both with and without SSL enabled. See the `XorStream` class in the IpcServiceSample.ServiceContracts project for an example of a stream translator.
162
+
163
+
Stream translators are also useful for logging packets for debugging. See the `LoggingStream` class in the IpcServiceSample.ServiceContracts project for an example of using a stream translator to log traffic.
0 commit comments