-
Notifications
You must be signed in to change notification settings - Fork 515
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add proper support for mutual TLS Improve javadoc Change-Id: I210abfbbd8dbd94d59393af739f3085d719ad623 Signed-off-by: Dave Kelsey <[email protected]>
- Loading branch information
Dave Kelsey
committed
Aug 23, 2018
1 parent
39ceca3
commit 5ef917f
Showing
4 changed files
with
64 additions
and
27 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
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 |
---|---|---|
|
@@ -38,17 +38,18 @@ test('\n\n***** Network End-to-end flow: invoke transaction to move money using | |
t.fail('Failed to import [email protected] into wallet'); | ||
} | ||
|
||
const tlsInfo = await e2eUtils.tlsEnroll('org1'); | ||
await inMemoryWallet.import('tlsId', X509WalletMixin.createIdentity('org1', tlsInfo.certificate, tlsInfo.key)); | ||
|
||
const network = new Network(); | ||
|
||
const ccp = fs.readFileSync(fixtures + '/network.json'); | ||
await network.initialize(JSON.parse(ccp.toString()), { | ||
wallet: inMemoryWallet, | ||
identity: '[email protected]' | ||
identity: '[email protected]', | ||
clientTlsIdentity: 'tlsId' | ||
}); | ||
|
||
const tlsInfo = await e2eUtils.tlsEnroll('org1'); | ||
network.getClient().setTlsClientCertAndKey(tlsInfo.certificate, tlsInfo.key); | ||
|
||
t.pass('Initialized the network'); | ||
|
||
const channel = await network.getChannel(channelName); | ||
|
@@ -103,18 +104,21 @@ test('\n\n***** Network End-to-end flow: invoke transaction to move money using | |
await fileSystemWallet.import(identityLabel, X509WalletMixin.createIdentity('Org1MSP', cert, key)); | ||
const exists = await fileSystemWallet.exists(identityLabel); | ||
t.ok(exists, 'Successfully imported [email protected] into wallet'); | ||
const tlsInfo = await e2eUtils.tlsEnroll('org1'); | ||
|
||
await fileSystemWallet.import('tlsId', X509WalletMixin.createIdentity('org1', tlsInfo.certificate, tlsInfo.key)); | ||
|
||
|
||
|
||
const network = new Network(); | ||
|
||
const ccp = fs.readFileSync(fixtures + '/network.json'); | ||
await network.initialize(JSON.parse(ccp.toString()), { | ||
wallet: fileSystemWallet, | ||
identity: identityLabel | ||
identity: identityLabel, | ||
clientTlsIdentity: 'tlsId' | ||
}); | ||
|
||
const tlsInfo = await e2eUtils.tlsEnroll('org1'); | ||
network.getClient().setTlsClientCertAndKey(tlsInfo.certificate, tlsInfo.key); | ||
|
||
t.pass('Initialized the network'); | ||
|
||
const channel = await network.getChannel(channelName); | ||
|