@@ -5,11 +5,45 @@ The demos in this directory are the complete source code for the applications
5
5
developed in the OpenSSL Guide tutorials. Refer to the various tutorial pages in
6
6
the [ guide] for an extensive discussion on the demos available here.
7
7
8
+ Running the TLS Demos
9
+ ---------------------
10
+
8
11
To run the demos when linked with a shared library (default) ensure that
9
12
libcrypto and libssl are on the library path. For example, assuming you have
10
13
already built OpenSSL from this source and in the default location then to run
11
14
the tls-client-block demo do this:
12
15
13
- LD_LIBRARY_PATH=../.. ./tls-client-block
16
+ LD_LIBRARY_PATH=../.. ./tls-client-block hostname port
17
+
18
+ In the above replace "hostname" and "port" with the hostname and the port number
19
+ of the server you are connecting to.
20
+
21
+ The above assumes that your default trusted certificate store containing trusted
22
+ CA certificates has been properly setup and configured as described on the
23
+ [ TLS Introduction] page.
24
+
25
+ You can run a test server to try out these demos using the "openssl s_server"
26
+ command line utility and using the test server certificate and key provided in
27
+ this directory. For example:
28
+
29
+ LD_LIBRARY_PATH=../.. ../../apps/openssl s_server -www -accept localhost:4443 -cert servercert.pem -key serverkey.pem
30
+
31
+ The test server certificate in this directory will use a CA that will not be in
32
+ your default trusted certificate store. The CA certificate to use is also
33
+ available in this directory. To use it you can override the default trusted
34
+ certificate store like this:
35
+
36
+ SSL_CERT_FILE=rootcert.pem LD_LIBRARY_PATH=../.. ./tls-client-block localhost 4443
37
+
38
+ If the above command is successful it will connect to the test "s_server" and
39
+ send a simple HTTP request to it. The server will respond with a page of
40
+ information giving details about the TLS connection that was used.
41
+
42
+ Note that the test server certificate used here is only suitable for use on
43
+ "localhost".
44
+
45
+ The tls-client-non-block demo can be run in exactly the same way. Just replace
46
+ "tls-client-block" in the above example commands with "tls-client-non-block".
14
47
15
48
[ guide ] : https://www.openssl.org/docs/manmaster/man7/ossl-guide-introduction.html
49
+ [ TLS Introduction ] : https://www.openssl.org/docs/manmaster/man7/ossl-guide-tls-introduction.html
0 commit comments