-
Notifications
You must be signed in to change notification settings - Fork 8
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
26 changed files
with
2,628 additions
and
755 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
library services; | ||
|
||
export 'src/enum_const.dart'; | ||
export 'src/rpc_client/channel_credentials.dart'; | ||
export 'src/rpc_client/client_channel.dart'; | ||
export 'src/rpc_client/refresh.dart'; | ||
export 'src/enum_const.dart'; | ||
|
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
27 changes: 27 additions & 0 deletions
27
packages/services/lib/src/rpc_client/channel_credentials.dart
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,27 @@ | ||
import 'dart:io'; | ||
|
||
import 'package:grpc/grpc.dart'; | ||
|
||
class ChannelCredentialsEx extends ChannelCredentials { | ||
List<int> certBytes; | ||
List<int> keyBytes; | ||
List<int> chainBytes; | ||
|
||
ChannelCredentialsEx(this.certBytes, this.keyBytes, this.chainBytes, | ||
{BadCertificateHandler onBadCertificate}) | ||
: super.secure(onBadCertificate: onBadCertificate); | ||
|
||
@override | ||
SecurityContext get securityContext { | ||
// SecurityContext context = new SecurityContext(withTrustedRoots: true); | ||
// context.setAlpnProtocols(supportedAlpnProtocols, false); | ||
// | ||
// // context.setTrustedCertificatesBytes(certBytes); | ||
// context.usePrivateKeyBytes(keyBytes); | ||
// context.useCertificateChainBytes(chainBytes); | ||
|
||
SecurityContext context = new SecurityContext(withTrustedRoots: true); | ||
context.setTrustedCertificatesBytes(certBytes); | ||
return context; | ||
} | ||
} |
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.