Skip to content

Commit 318cbd3

Browse files
committed
Adding TLS support
1 parent 1e10158 commit 318cbd3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1329
-1339
lines changed

.classpath

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<attribute name="maven.pomderived" value="true"/>
1313
</attributes>
1414
</classpathentry>
15-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
15+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
1616
<attributes>
1717
<attribute name="maven.pomderived" value="true"/>
1818
</attributes>

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
target
33
.metadata
44
bin/org
5+
keystore
6+
truststore

README.md

+23-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ Java client library and server testing module for [NATS messaging system](http:/
55
## Supported Platforms
66

77
java_nats currently supports following Java Platforms :
8-
- Java Platform, Standard Edition 7 (Java SE 7)
98
- Java Platform, Standard Edition 8 (Java SE 8)
109

1110
## Getting Started
@@ -16,7 +15,7 @@ Add dependency to Maven pom.xml
1615
<dependency>
1716
<groupId>com.github.tyagihas</groupId>
1817
<artifactId>java_nats</artifactId>
19-
<version>0.6.1</version>
18+
<version>0.7.0</version>
2019
</dependency>
2120
```
2221

@@ -197,7 +196,27 @@ Connection conn2 = Connection.connect(new Properties(), new MsgHandler() {
197196
});
198197
```
199198

200-
See examples and benchmarks for more information..
199+
## TLS
200+
201+
* Use "keytool" to create TrustStore and KeyStore (if necessary) or specify existing ones in next step.
202+
203+
* Set properties to configure TrustStore and KeyStore.
204+
205+
```java
206+
Properties props = new Properties();
207+
props.put("truststore", "./truststore");
208+
props.put("truststore_pass", "password");
209+
// KeyStore is used only when tlsverify is set on the server.
210+
props.put("keystore", "./keystore");
211+
props.put("keystore_pass", "password");
212+
213+
// Automatically detect if TLS is configured on the server.
214+
Connection conn = Connection.connect(props);
215+
```
216+
217+
* It may be required to set TLS "timeout" parameter longer than default.
218+
219+
See examples and benchmarks for more information.
201220

202221
## Nats Embedded Server (beta)
203222

@@ -215,7 +234,7 @@ Start a Nats Embedded Server from command line. Assume CLASSPATH contains java_n
215234
```
216235

217236
Nats Embedded Server is intended for dev and unit testing and not for production use. Following features haven't been implemented in Nats Embedded Server.
218-
* SSL/TSL
237+
* TLS
219238
* Clustering
220239

221240
## License

doc/allclasses-frame.html

+3-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
<!-- NewPage -->
33
<html lang="en">
44
<head>
5-
<!-- Generated by javadoc (1.8.0_91) on Thu Aug 11 22:25:11 JST 2016 -->
6-
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
7-
<title>All Classes (Java Nats Client 0.6.1 API)</title>
8-
<meta name="date" content="2016-08-11">
5+
<!-- Generated by javadoc (1.8.0_51) on Thu Nov 17 16:20:07 JST 2016 -->
6+
<title>All Classes</title>
7+
<meta name="date" content="2016-11-17">
98
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
109
<script type="text/javascript" src="script.js"></script>
1110
</head>

doc/allclasses-noframe.html

+3-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
<!-- NewPage -->
33
<html lang="en">
44
<head>
5-
<!-- Generated by javadoc (1.8.0_91) on Thu Aug 11 22:25:11 JST 2016 -->
6-
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
7-
<title>All Classes (Java Nats Client 0.6.1 API)</title>
8-
<meta name="date" content="2016-08-11">
5+
<!-- Generated by javadoc (1.8.0_51) on Thu Nov 17 16:20:07 JST 2016 -->
6+
<title>All Classes</title>
7+
<meta name="date" content="2016-11-17">
98
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
109
<script type="text/javascript" src="script.js"></script>
1110
</head>

doc/constant-values.html

+6-8
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@
22
<!-- NewPage -->
33
<html lang="en">
44
<head>
5-
<!-- Generated by javadoc (1.8.0_91) on Thu Aug 11 22:25:11 JST 2016 -->
6-
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
7-
<title>Constant Field Values (Java Nats Client 0.6.1 API)</title>
8-
<meta name="date" content="2016-08-11">
5+
<!-- Generated by javadoc (1.8.0_51) on Thu Nov 17 16:20:06 JST 2016 -->
6+
<title>Constant Field Values</title>
7+
<meta name="date" content="2016-11-17">
98
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
109
<script type="text/javascript" src="script.js"></script>
1110
</head>
1211
<body>
1312
<script type="text/javascript"><!--
1413
try {
1514
if (location.href.indexOf('is-external=true') == -1) {
16-
parent.document.title="Constant Field Values (Java Nats Client 0.6.1 API)";
15+
parent.document.title="Constant Field Values";
1716
}
1817
}
1918
catch(err) {
@@ -38,7 +37,7 @@
3837
<li>Use</li>
3938
<li><a href="overview-tree.html">Tree</a></li>
4039
<li><a href="deprecated-list.html">Deprecated</a></li>
41-
<li><a href="index-all.html">Index</a></li>
40+
<li><a href="index-files/index-1.html">Index</a></li>
4241
<li><a href="help-doc.html">Help</a></li>
4342
</ul>
4443
</div>
@@ -89,7 +88,7 @@ <h2 title="Contents">Contents</h2>
8988
<li>Use</li>
9089
<li><a href="overview-tree.html">Tree</a></li>
9190
<li><a href="deprecated-list.html">Deprecated</a></li>
92-
<li><a href="index-all.html">Index</a></li>
91+
<li><a href="index-files/index-1.html">Index</a></li>
9392
<li><a href="help-doc.html">Help</a></li>
9493
</ul>
9594
</div>
@@ -121,6 +120,5 @@ <h2 title="Contents">Contents</h2>
121120
<!-- -->
122121
</a></div>
123122
<!-- ======== END OF BOTTOM NAVBAR ======= -->
124-
<p class="legalCopy"><small>Copyright &#169; 2016. All rights reserved.</small></p>
125123
</body>
126124
</html>

doc/deprecated-list.html

+6-8
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@
22
<!-- NewPage -->
33
<html lang="en">
44
<head>
5-
<!-- Generated by javadoc (1.8.0_91) on Thu Aug 11 22:25:11 JST 2016 -->
6-
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
7-
<title>Deprecated List (Java Nats Client 0.6.1 API)</title>
8-
<meta name="date" content="2016-08-11">
5+
<!-- Generated by javadoc (1.8.0_51) on Thu Nov 17 16:20:06 JST 2016 -->
6+
<title>Deprecated List</title>
7+
<meta name="date" content="2016-11-17">
98
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
109
<script type="text/javascript" src="script.js"></script>
1110
</head>
1211
<body>
1312
<script type="text/javascript"><!--
1413
try {
1514
if (location.href.indexOf('is-external=true') == -1) {
16-
parent.document.title="Deprecated List (Java Nats Client 0.6.1 API)";
15+
parent.document.title="Deprecated List";
1716
}
1817
}
1918
catch(err) {
@@ -38,7 +37,7 @@
3837
<li>Use</li>
3938
<li><a href="overview-tree.html">Tree</a></li>
4039
<li class="navBarCell1Rev">Deprecated</li>
41-
<li><a href="index-all.html">Index</a></li>
40+
<li><a href="index-files/index-1.html">Index</a></li>
4241
<li><a href="help-doc.html">Help</a></li>
4342
</ul>
4443
</div>
@@ -89,7 +88,7 @@ <h2 title="Contents">Contents</h2>
8988
<li>Use</li>
9089
<li><a href="overview-tree.html">Tree</a></li>
9190
<li class="navBarCell1Rev">Deprecated</li>
92-
<li><a href="index-all.html">Index</a></li>
91+
<li><a href="index-files/index-1.html">Index</a></li>
9392
<li><a href="help-doc.html">Help</a></li>
9493
</ul>
9594
</div>
@@ -121,6 +120,5 @@ <h2 title="Contents">Contents</h2>
121120
<!-- -->
122121
</a></div>
123122
<!-- ======== END OF BOTTOM NAVBAR ======= -->
124-
<p class="legalCopy"><small>Copyright &#169; 2016. All rights reserved.</small></p>
125123
</body>
126124
</html>

doc/help-doc.html

+7-9
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@
22
<!-- NewPage -->
33
<html lang="en">
44
<head>
5-
<!-- Generated by javadoc (1.8.0_91) on Thu Aug 11 22:25:11 JST 2016 -->
6-
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
7-
<title>API Help (Java Nats Client 0.6.1 API)</title>
8-
<meta name="date" content="2016-08-11">
5+
<!-- Generated by javadoc (1.8.0_51) on Thu Nov 17 16:20:07 JST 2016 -->
6+
<title>API Help</title>
7+
<meta name="date" content="2016-11-17">
98
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
109
<script type="text/javascript" src="script.js"></script>
1110
</head>
1211
<body>
1312
<script type="text/javascript"><!--
1413
try {
1514
if (location.href.indexOf('is-external=true') == -1) {
16-
parent.document.title="API Help (Java Nats Client 0.6.1 API)";
15+
parent.document.title="API Help";
1716
}
1817
}
1918
catch(err) {
@@ -38,7 +37,7 @@
3837
<li>Use</li>
3938
<li><a href="overview-tree.html">Tree</a></li>
4039
<li><a href="deprecated-list.html">Deprecated</a></li>
41-
<li><a href="index-all.html">Index</a></li>
40+
<li><a href="index-files/index-1.html">Index</a></li>
4241
<li class="navBarCell1Rev">Help</li>
4342
</ul>
4443
</div>
@@ -155,7 +154,7 @@ <h2>Deprecated API</h2>
155154
</li>
156155
<li class="blockList">
157156
<h2>Index</h2>
158-
<p>The <a href="index-all.html">Index</a> contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.</p>
157+
<p>The <a href="index-files/index-1.html">Index</a> contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.</p>
159158
</li>
160159
<li class="blockList">
161160
<h2>Prev/Next</h2>
@@ -194,7 +193,7 @@ <h2>Constant Field Values</h2>
194193
<li>Use</li>
195194
<li><a href="overview-tree.html">Tree</a></li>
196195
<li><a href="deprecated-list.html">Deprecated</a></li>
197-
<li><a href="index-all.html">Index</a></li>
196+
<li><a href="index-files/index-1.html">Index</a></li>
198197
<li class="navBarCell1Rev">Help</li>
199198
</ul>
200199
</div>
@@ -226,6 +225,5 @@ <h2>Constant Field Values</h2>
226225
<!-- -->
227226
</a></div>
228227
<!-- ======== END OF BOTTOM NAVBAR ======= -->
229-
<p class="legalCopy"><small>Copyright &#169; 2016. All rights reserved.</small></p>
230228
</body>
231229
</html>

doc/index-all.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<!-- NewPage -->
33
<html lang="en">
44
<head>
5-
<!-- Generated by javadoc (1.8.0_91) on Thu Aug 11 22:25:11 JST 2016 -->
5+
<!-- Generated by javadoc (1.8.0_91) on Thu Aug 11 22:28:23 JST 2016 -->
66
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
77
<title>Index (Java Nats Client 0.6.1 API)</title>
88
<meta name="date" content="2016-08-11">

doc/index-files/index-1.html

+4-26
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<!-- NewPage -->
33
<html lang="en">
44
<head>
5-
<!-- Generated by javadoc (1.8.0_51) on Wed Aug 10 20:13:33 JST 2016 -->
5+
<!-- Generated by javadoc (1.8.0_51) on Thu Nov 17 16:20:06 JST 2016 -->
66
<title>A-Index</title>
7-
<meta name="date" content="2016-08-10">
7+
<meta name="date" content="2016-11-17">
88
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">
99
<script type="text/javascript" src="../script.js"></script>
1010
</head>
@@ -69,37 +69,15 @@
6969
<!-- -->
7070
</a></div>
7171
<!-- ========= END OF TOP NAVBAR ========= -->
72-
<div class="contentContainer"><a href="index-1.html">A</a>&nbsp;<a href="index-2.html">B</a>&nbsp;<a href="index-3.html">C</a>&nbsp;<a href="index-4.html">D</a>&nbsp;<a href="index-5.html">E</a>&nbsp;<a href="index-6.html">F</a>&nbsp;<a href="index-7.html">G</a>&nbsp;<a href="index-8.html">I</a>&nbsp;<a href="index-9.html">M</a>&nbsp;<a href="index-10.html">N</a>&nbsp;<a href="index-11.html">O</a>&nbsp;<a href="index-12.html">P</a>&nbsp;<a href="index-13.html">Q</a>&nbsp;<a href="index-14.html">R</a>&nbsp;<a href="index-15.html">S</a>&nbsp;<a href="index-16.html">T</a>&nbsp;<a href="index-17.html">U</a>&nbsp;<a href="index-18.html">V</a>&nbsp;<a href="index-19.html">W</a>&nbsp;<a name="I:A">
72+
<div class="contentContainer"><a href="index-1.html">A</a>&nbsp;<a href="index-2.html">C</a>&nbsp;<a href="index-3.html">E</a>&nbsp;<a href="index-4.html">F</a>&nbsp;<a href="index-5.html">G</a>&nbsp;<a href="index-6.html">I</a>&nbsp;<a href="index-7.html">M</a>&nbsp;<a href="index-8.html">N</a>&nbsp;<a href="index-9.html">O</a>&nbsp;<a href="index-10.html">P</a>&nbsp;<a href="index-11.html">R</a>&nbsp;<a href="index-12.html">S</a>&nbsp;<a href="index-13.html">T</a>&nbsp;<a href="index-14.html">U</a>&nbsp;<a name="I:A">
7373
<!-- -->
7474
</a>
7575
<h2 class="title">A</h2>
7676
<dl>
77-
<dt><span class="memberNameLink"><a href="../org/nats/common/NatsMonitor.html#addResource-java.lang.String-org.nats.common.NatsMonitor.Resource-">addResource(String, NatsMonitor.Resource)</a></span> - Method in class org.nats.common.<a href="../org/nats/common/NatsMonitor.html" title="class in org.nats.common">NatsMonitor</a></dt>
78-
<dd>
79-
<div class="block">Add targeting Resource to the list.</div>
80-
</dd>
81-
<dt><span class="memberNameLink"><a href="../org/nats/Server.html#addServers-java.util.Properties-">addServers(Properties)</a></span> - Static method in class org.nats.<a href="../org/nats/Server.html" title="class in org.nats">Server</a></dt>
82-
<dd>
83-
<div class="block">Parse opts properties and build Nats server list.</div>
84-
</dd>
8577
<dt><span class="memberNameLink"><a href="../org/nats/MsgHandler.html#arity">arity</a></span> - Variable in class org.nats.<a href="../org/nats/MsgHandler.html" title="class in org.nats">MsgHandler</a></dt>
8678
<dd>&nbsp;</dd>
87-
<dt><span class="memberNameLink"><a href="../org/nats/common/Constants.html#ARR">ARR</a></span> - Static variable in class org.nats.common.<a href="../org/nats/common/Constants.html" title="class in org.nats.common">Constants</a></dt>
88-
<dd>&nbsp;</dd>
89-
<dt><a href="../org/nats/examples/Auth.html" title="class in org.nats.examples"><span class="typeNameLink">Auth</span></a> - Class in <a href="../org/nats/examples/package-summary.html">org.nats.examples</a></dt>
90-
<dd>&nbsp;</dd>
91-
<dt><span class="memberNameLink"><a href="../org/nats/examples/Auth.html#Auth--">Auth()</a></span> - Constructor for class org.nats.examples.<a href="../org/nats/examples/Auth.html" title="class in org.nats.examples">Auth</a></dt>
92-
<dd>&nbsp;</dd>
93-
<dt><a href="../org/nats/examples/AutoUnsub.html" title="class in org.nats.examples"><span class="typeNameLink">AutoUnsub</span></a> - Class in <a href="../org/nats/examples/package-summary.html">org.nats.examples</a></dt>
94-
<dd>&nbsp;</dd>
95-
<dt><span class="memberNameLink"><a href="../org/nats/examples/AutoUnsub.html#AutoUnsub--">AutoUnsub()</a></span> - Constructor for class org.nats.examples.<a href="../org/nats/examples/AutoUnsub.html" title="class in org.nats.examples">AutoUnsub</a></dt>
96-
<dd>&nbsp;</dd>
97-
<dt><span class="memberNameLink"><a href="../org/nats/common/Constants.html#AWAITING_CONTROL">AWAITING_CONTROL</a></span> - Static variable in class org.nats.common.<a href="../org/nats/common/Constants.html" title="class in org.nats.common">Constants</a></dt>
98-
<dd>&nbsp;</dd>
99-
<dt><span class="memberNameLink"><a href="../org/nats/common/Constants.html#AWAITING_MSG_PAYLOAD">AWAITING_MSG_PAYLOAD</a></span> - Static variable in class org.nats.common.<a href="../org/nats/common/Constants.html" title="class in org.nats.common">Constants</a></dt>
100-
<dd>&nbsp;</dd>
10179
</dl>
102-
<a href="index-1.html">A</a>&nbsp;<a href="index-2.html">B</a>&nbsp;<a href="index-3.html">C</a>&nbsp;<a href="index-4.html">D</a>&nbsp;<a href="index-5.html">E</a>&nbsp;<a href="index-6.html">F</a>&nbsp;<a href="index-7.html">G</a>&nbsp;<a href="index-8.html">I</a>&nbsp;<a href="index-9.html">M</a>&nbsp;<a href="index-10.html">N</a>&nbsp;<a href="index-11.html">O</a>&nbsp;<a href="index-12.html">P</a>&nbsp;<a href="index-13.html">Q</a>&nbsp;<a href="index-14.html">R</a>&nbsp;<a href="index-15.html">S</a>&nbsp;<a href="index-16.html">T</a>&nbsp;<a href="index-17.html">U</a>&nbsp;<a href="index-18.html">V</a>&nbsp;<a href="index-19.html">W</a>&nbsp;</div>
80+
<a href="index-1.html">A</a>&nbsp;<a href="index-2.html">C</a>&nbsp;<a href="index-3.html">E</a>&nbsp;<a href="index-4.html">F</a>&nbsp;<a href="index-5.html">G</a>&nbsp;<a href="index-6.html">I</a>&nbsp;<a href="index-7.html">M</a>&nbsp;<a href="index-8.html">N</a>&nbsp;<a href="index-9.html">O</a>&nbsp;<a href="index-10.html">P</a>&nbsp;<a href="index-11.html">R</a>&nbsp;<a href="index-12.html">S</a>&nbsp;<a href="index-13.html">T</a>&nbsp;<a href="index-14.html">U</a>&nbsp;</div>
10381
<!-- ======= START OF BOTTOM NAVBAR ====== -->
10482
<div class="bottomNav"><a name="navbar.bottom">
10583
<!-- -->

0 commit comments

Comments
 (0)