Skip to content

Instantly share code, notes, and snippets.

/*
*
* Copyright 2018 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@ZhenLian
ZhenLian / provider_test.go
Created August 17, 2020 16:19
Use a Tmp file to test the Provider in Go
/*
*
* Copyright 2020 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@Override
public X509Certificate[] getAcceptedIssuers() {
X509Certificate[] certs;
try {
List<X509Certificate> trustCerts = new ArrayList<>();
KeyStore ks = tlsOptions.getTrustedCerts();
Enumeration<String> aliases = ks.aliases();
while (aliases.hasMoreElements()) {
Certificate c = ks.getCertificate(aliases.nextElement());
if (c instanceof X509Certificate) {