Skip to content

Commit

Permalink
Added sample configuration for testing interoperability with stunnel …
Browse files Browse the repository at this point in the history
…encryption wrapped server.
  • Loading branch information
garthpatil committed Apr 11, 2013
1 parent 6a9f3be commit 3f55aa1
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 4 deletions.
7 changes: 5 additions & 2 deletions SSL.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Generating Keys and Certificates with OpenSSL

Generating a CSR from keytool

keytool -certreq -alias jetty -keystore keystore -file smpp.csr
keytool -certreq -alias smpp -keystore keystore -file smpp.csr

Generating a CSR from OpenSSL

Expand All @@ -98,8 +98,11 @@ The following OpenSSL command combines the keys in smpp.key and the certificate

## Appendix

### Known issues
### Interop with stunnel

This library has been tested with stunnel4 wrapping both client and servers. There is a sample stunnel.conf in src/test/resources that works with `make server` and `make ssl-client`. The SSL implementation should be compatible with other TLS/SSL encryption wrappers, assuming the JDK you are using supports the same cryptographic algorithms as the encryption wrapper.

### Known issues



2 changes: 1 addition & 1 deletion src/test/java/com/cloudhopper/smpp/demo/SslClientMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public Thread newThread(Runnable r) {
config0.setName("Tester.Session.0");
config0.setType(SmppBindType.TRANSCEIVER);
config0.setHost("127.0.0.1");
config0.setPort(2776);
config0.setPort(2777);
config0.setConnectTimeout(10000);
config0.setSystemId("1234567890");
config0.setPassword("password");
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/cloudhopper/smpp/demo/SslServerMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public Thread newThread(Runnable r) {

// create a server configuration
SmppServerConfiguration configuration = new SmppServerConfiguration();
configuration.setPort(2776);
configuration.setPort(2777);
configuration.setMaxConnectionSize(10);
configuration.setNonBlockingSocketsEnabled(true);
configuration.setDefaultRequestExpiryTimeout(30000);
Expand Down
13 changes: 13 additions & 0 deletions src/test/resources/server.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
-----BEGIN CERTIFICATE-----
MIICATCCAWoCCQCEwdEo1Uc29TANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJB
VTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0
cyBQdHkgTHRkMB4XDTEzMDQxMDIzNTI1M1oXDTE0MDQxMDIzNTI1M1owRTELMAkG
A1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0
IFdpZGdpdHMgUHR5IEx0ZDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAs9ao
eqfWIKjMQ+hggOclu6/zftOrvoCcZ8HYoE5G2YOQuvT2zIcTDR5EHcMuhlkF/5SV
ta4baG6EZdO/WE3sJcVjJ64/5gBAXAOzw+f/pNoPyEGnFzpJugKemy0WntdHZZ9h
83OO2iKdk1Oco+7qc7MFaItoQsempiQPniQa+uMCAwEAATANBgkqhkiG9w0BAQUF
AAOBgQBxUQtSeudvSUFNZSR7QdW3Kh8Gb1+ay9LNnQ/rcW+5pXk88inHIIzIdjo9
NUwhRNLRyQUzW7sHTOut5lEZpkkOTFopoa2lmwyw7pZqDoVm71aKmxoCK5nwC8t7
O4cHK2mWeZ1moUuemdKQZFVMAGS8TBgTlCump311o/2qOzEZaw==
-----END CERTIFICATE-----
15 changes: 15 additions & 0 deletions src/test/resources/server.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
-----BEGIN RSA PRIVATE KEY-----
MIICXQIBAAKBgQCz1qh6p9YgqMxD6GCA5yW7r/N+06u+gJxnwdigTkbZg5C69PbM
hxMNHkQdwy6GWQX/lJW1rhtoboRl079YTewlxWMnrj/mAEBcA7PD5/+k2g/IQacX
Okm6Ap6bLRae10dln2Hzc47aIp2TU5yj7upzswVoi2hCx6amJA+eJBr64wIDAQAB
AoGALzCboxvZb1Z7yzH16L0+xIJGJbiLb4C2Ce/u1RnVM4x3dOeEv2SOVjnj699k
nPJNRaSKqFLYdE3TxhiLNDO2TD5fhCHdwN+bczNLX7FH2LRGgVNi7WNGLcFOKXkp
WPke9zxcqTT6QiCw9upa2VrzzMFK7mb1pYPaGDOktdraWBkCQQDa1KSQ5n3OL6ue
xHS4Nl+AJhu0dtbaHD4/lKZMINbH5x/yZ8Jl0YI16cWf0ERfSqIjCWLybYaWp23D
y36YHkh1AkEA0mKHzFMg/StWojLGOQmYS8SGEm6g5USOiovq2v5LYVN+kPpJj9qf
ju6cPsfOuFnXpknw/x0dji0dKvHTAgSK9wJBAIwmRiN7SzVjeIHdhnd4c1+KiJHi
zqWwEvn7hSoamhQ7ZU2FwI4fSUqoJua8px10mjTgTRvAo8MXBgiw6qoYMwUCQQC1
hbIpx6f1CMmtFSYW3IJ9DUmo6a8FYkuimuq+nR6pEQNpT6rc5gM5rgM93+QrB8mb
frzjQVnY7G/4N8KaQRUtAkAaJnEV2MFXgKdiE8uLuGnrRBjRovDxM93H3zjlTAaO
fSkL6WL8/g2RYrw2/W4WNu8I9Eqh0XlqSelFQYLd5FQE
-----END RSA PRIVATE KEY-----
9 changes: 9 additions & 0 deletions src/test/resources/stunnel.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
client=no
foreground=yes
debug=7
pid=/tmp/stunnel.pid
cert=src/test/resources/server.crt
key=src/test/resources/server.key
[smpp]
accept=2777
connect=127.0.0.1:2776

0 comments on commit 3f55aa1

Please sign in to comment.