Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

recreate certs for SSL example configs #866

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions Examples/Executor/Examples.Executor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,6 @@
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<None Include="..\QuickFixn-TestCA.cer" Link="QuickFixn-TestCA.cer">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\QuickFixn-TestServer.pfx" Link="QuickFixn-TestServer.pfx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\Messages\FIX40\QuickFix.FIX40.csproj" />
<ProjectReference Include="..\..\Messages\FIX41\QuickFix.FIX41.csproj" />
Expand Down
6 changes: 3 additions & 3 deletions Examples/Executor/executor_ssl.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ ScreenLogShowEvents=Y

SSLEnable=Y
# It is recommended to install the certificate and refer to it by name instead of using filename + password
SSLCertificate=../QuickFixn-TestServer.pfx
SSLCertificatePassword=QuickFixn-TestServer
SSLCertificate=../qfn-server.demo.pfx
SSLCertificatePassword=qfnpass123
# For production refer to certificate by name instead: SSLCertificate=CN=QuickFixn-TestServer
SSLCACertificate=../QuickFixn-TestCA.cer
SSLCACertificate=../quickfixn-CA.demo.cer
SSLCheckCertificateRevocation=N

[SESSION]
Expand Down
Binary file removed Examples/QuickFixn-TestCA.cer
Binary file not shown.
Binary file removed Examples/QuickFixn-TestCA.pfx
Binary file not shown.
Binary file removed Examples/QuickFixn-TestClient.pfx
Binary file not shown.
Binary file removed Examples/QuickFixn-TestServer.pfx
Binary file not shown.
9 changes: 0 additions & 9 deletions Examples/SimpleAcceptor/Examples.SimpleAcceptor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,6 @@
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<None Include="..\QuickFixn-TestCA.cer" Link="QuickFixn-TestCA.cer">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\QuickFixn-TestServer.pfx" Link="QuickFixn-TestServer.pfx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\QuickFIXn\QuickFix.csproj" />
</ItemGroup>
Expand Down
9 changes: 0 additions & 9 deletions Examples/TradeClient/Examples.TradeClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,6 @@
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<None Include="..\QuickFixn-TestCA.cer" Link="QuickFixn-TestCA.cer">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\QuickFixn-TestClient.pfx" Link="QuickFixn-TestClient.pfx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\Messages\FIX44\QuickFix.FIX44.csproj" />
<ProjectReference Include="..\..\QuickFIXn\QuickFix.csproj" />
Expand Down
8 changes: 4 additions & 4 deletions Examples/TradeClient/tradeclient_ssl.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ LogoutTimeout=5
ResetOnLogon=Y

# It is recommended to install the certificate and refer to it by name instead of using filename + password
SSLCertificate=../QuickFixn-TestClient.pfx
SSLCertificatePassword=QuickFixn-TestClient
SSLCertificate=../qfn-client.demo.pfx
SSLCertificatePassword=qfnpass123
# For production refer to certificate by name instead: SSLCertificate=CN=QuickFixn-TestClient
SSLServerName=QuickFixn-TestServer
SSLCACertificate=../QuickFixn-TestCA.cer
SSLServerName=qfn-server.demo
SSLCACertificate=../quickfixn-CA.demo.cer

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need SSLCheckCertificateRevocation=N in this config

[SESSION]
# inherit ConnectionType, ReconnectInterval and SenderCompID from default
Expand Down
14 changes: 14 additions & 0 deletions Examples/gen-cert-scripts/step1_gen_ca_cert.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
###################
# Generate CA cert
# (may not need SAN here)

openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 \
-nodes -keyout quickfixn-CA.demo.key -out quickfixn-CA.demo.cer -subj "/CN=quickfixn-CA.demo" \
-addext "subjectAltName=DNS:localhost,IP:127.0.0.1"


# I'm using "qfnpass123" for all passwords

openssl pkcs12 -export -out quickfixn-CA.demo.pfx -inkey quickfixn-CA.demo.key -in quickfixn-CA.demo.cer


16 changes: 16 additions & 0 deletions Examples/gen-cert-scripts/step2_gen_server_cert.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
###################
# Generate Server cert

openssl req -new -nodes -newkey rsa:4096 \
-keyout qfn-server.demo.key \
-out qfn-server.demo.csr \
-subj "/CN=qfn-server.demo" \
-addext "subjectAltName=DNS:localhost,IP:127.0.0.1" \
-addext "extendedKeyUsage=serverAuth"

openssl x509 -req -in qfn-server.demo.csr -CA quickfixn-CA.demo.cer -CAkey quickfixn-CA.demo.key \
-CAcreateserial -out qfn-server.demo.cer -days 3650 -sha256 -copy_extensions copy

openssl pkcs12 -export -out qfn-server.demo.pfx -inkey qfn-server.demo.key -in qfn-server.demo.cer


17 changes: 17 additions & 0 deletions Examples/gen-cert-scripts/step3_gen_client_cert.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
###################
# Generate Client cert

openssl req -new -nodes -newkey rsa:4096 \
-keyout qfn-client.demo.key \
-out qfn-client.demo.csr \
-subj "/CN=qfn-client.demo" \
-addext "subjectAltName=DNS:localhost,IP:127.0.0.1" \
-addext "extendedKeyUsage=clientAuth"

openssl x509 -req -in qfn-client.demo.csr -CA quickfixn-CA.demo.cer -CAkey quickfixn-CA.demo.key \
-CAcreateserial -out qfn-client.demo.cer -days 3650 -sha256 -copy_extensions copy

openssl pkcs12 -export -out qfn-client.demo.pfx -inkey qfn-client.demo.key -in qfn-client.demo.cer



Binary file added Examples/qfn-client.demo.pfx
Binary file not shown.
Binary file added Examples/qfn-server.demo.pfx
Binary file not shown.
30 changes: 30 additions & 0 deletions Examples/quickfixn-CA.demo.cer
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
-----BEGIN CERTIFICATE-----
MIIFNTCCAx2gAwIBAgIUYOHtQANN5RgxdpEA/CCSoH6jspQwDQYJKoZIhvcNAQEL
BQAwHDEaMBgGA1UEAwwRcXVpY2tmaXhuLUNBLmRlbW8wHhcNMjQwNzA5MTYwODQ2
WhcNMzQwNzA3MTYwODQ2WjAcMRowGAYDVQQDDBFxdWlja2ZpeG4tQ0EuZGVtbzCC
AiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBALzcuXwP0zE2T4WMQhGM2j8c
eJRZRCm0VeGnYZsOuHC2X+krhNm2hEuUecB+F3fohIJFCccQgyoqIQw6ET1GBEy0
B/u+HoxkpISepV23xY7gog96YaUX1l6N7+f/XwCrZE03AGl/kVeIO6tDvQCQNfKK
+e9Yk8A0qKKG+K9aN84oQEubJdjmFnrhqa10s/DrUxP14pKWChWDLJQAdpZip+KS
Vmyn1bF9evwsxIz9Nrk9/XcMRYujpgNiuhjbM8jNZouhzbqha6LATpPFa74cffeI
dZEJx4ZKoOEqANCz76rbZ0bq+wh/zuOka+0Y5PX3iUlvneHMNj4RfSElDn6vN9Px
5WOgZIIFaGj8rlXndIsPD2hyEx34TJwqLpf4urHi6OCo4G7AdDhoeV7vuwVgcdco
7vdg8BM3UEAOoqKQ+XwE0HBivW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