-
Notifications
You must be signed in to change notification settings - Fork 636
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
860 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
date: 2017-02-03T14:12:47-05:00 | ||
title: keytool | ||
--- | ||
|
||
This is a Java command line tool to generate and manipulate keys. | ||
|
||
To create a server.keystore for TLS. | ||
|
||
``` | ||
keytool -genkey -alias mycert -keyalg RSA -sigalg MD5withRSA -keystore server.keystore -storepass secret -keypass secret -validity 9999 | ||
``` | ||
And then copy this file to light-java/src/main/resources/config/tls folder. At | ||
the same time, update server.json for keystoreName, keystorePass, keyPass. | ||
|
||
``` | ||
{ | ||
"description": "server config", | ||
"ip": "0.0.0.0", | ||
"httpPort": 8080, | ||
"enableHttp": true, | ||
"httpsPort": 8443, | ||
"enableHttps": true, | ||
"keystoreName": "tls/server.keystore", | ||
"keystorePass": "secret", | ||
"keyPass": "secret", | ||
"enableTwoWayTls": false, | ||
"truststoreName": "tls/server.truststore", | ||
"truststorePass": "password", | ||
"serviceId": "com.networknt.petstore-1.0.0", | ||
"enableRegistry": false | ||
} | ||
``` |
20 changes: 20 additions & 0 deletions
20
server/src/main/java/com/networknt/server/DummyTrustManager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.networknt.server; | ||
|
||
import javax.net.ssl.X509TrustManager; | ||
import java.security.cert.X509Certificate; | ||
|
||
/** | ||
* Created by steve on 03/02/17. | ||
*/ | ||
public class DummyTrustManager implements X509TrustManager { | ||
|
||
public X509Certificate[] getAcceptedIssuers() { | ||
return new X509Certificate[] {}; | ||
} | ||
|
||
public void checkClientTrusted(X509Certificate[] certs, String authType) { | ||
} | ||
|
||
public void checkServerTrusted(X509Certificate[] certs, String authType) { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.