Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
e4fc0a0
feat: support keystore in transport for mtls
arithmetic1728 Oct 15, 2020
3f3d403
fix format
arithmetic1728 Oct 15, 2020
0feec05
update code
arithmetic1728 Oct 15, 2020
a71a009
add tests
arithmetic1728 Oct 16, 2020
3c10eaa
update test and doc
arithmetic1728 Oct 16, 2020
275bad0
update names
arithmetic1728 Oct 23, 2020
e21791c
create keystore from cert and key string
arithmetic1728 Oct 23, 2020
2edb134
change certAndKey from string to inputstream
arithmetic1728 Oct 26, 2020
09847d7
add mtls file
arithmetic1728 Oct 27, 2020
c4bc00d
Update google-http-client/src/main/java/com/google/api/client/http/ja…
arithmetic1728 Oct 29, 2020
a97ea3d
Update google-http-client/src/main/java/com/google/api/client/http/ja…
arithmetic1728 Oct 29, 2020
7469467
Update google-http-client/src/main/java/com/google/api/client/util/Ss…
arithmetic1728 Oct 29, 2020
a61ed1a
Update google-http-client/src/main/java/com/google/api/client/util/Ss…
arithmetic1728 Oct 29, 2020
93c3452
Update google-http-client/src/test/java/com/google/api/client/util/Se…
arithmetic1728 Oct 29, 2020
d195f65
Update google-http-client/src/main/java/com/google/api/client/util/Ss…
arithmetic1728 Oct 29, 2020
13d7d19
update the code
arithmetic1728 Oct 29, 2020
bade79a
fix name
arithmetic1728 Oct 29, 2020
a8d60ea
chore: add Beta annotation for new mtls functions
arithmetic1728 Oct 30, 2020
271c262
resolve conflict
arithmetic1728 Oct 30, 2020
eb9a90d
update Beta
arithmetic1728 Oct 30, 2020
f90ac74
add since tag
arithmetic1728 Oct 30, 2020
509c481
Merge branch 'master' of https://github.com/googleapis/google-http-ja…
arithmetic1728 Oct 31, 2020
fc72936
feat: add isMtls property to ApacheHttpTransport
arithmetic1728 Oct 29, 2020
02e53d2
update Beta annotation
arithmetic1728 Oct 31, 2020
254675e
format
arithmetic1728 Nov 1, 2020
f477636
Merge pull request #2 from arithmetic1728/apache
arithmetic1728 Nov 1, 2020
a14cac4
fix tag
arithmetic1728 Nov 1, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add mtls file
  • Loading branch information
arithmetic1728 committed Oct 27, 2020
commit 09847d7a4d836e617e4a5512553dfc6feb7d0fae
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,8 @@

import com.google.api.client.testing.json.webtoken.TestCertificates;
import com.google.api.client.testing.util.SecurityTestUtils;
import com.google.common.io.Resources;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.security.KeyStore;
import java.security.PrivateKey;
import java.security.Signature;
Expand Down Expand Up @@ -207,14 +204,10 @@ public void run() throws Throwable {
}

public void testCreateMtlsKeyStoreSuccess() throws Exception {
URL url = getClass().getClassLoader().getResource("com/google/api/client/util/cert.pem");
String cert = Resources.toString(url, StandardCharsets.UTF_8);

url = getClass().getClassLoader().getResource("com/google/api/client/util/privateKey.pem");
String privateKey = Resources.toString(url, StandardCharsets.UTF_8);

String certAndKeyString = privateKey + "\n" + cert;
ByteArrayInputStream certAndKey = new ByteArrayInputStream(certAndKeyString.getBytes());
InputStream certAndKey =
getClass()
.getClassLoader()
.getResourceAsStream("com/google/api/client/util/mtlsCertAndKey.pem");

KeyStore mtlsKeyStore = SecurityUtils.createMtlsKeyStore(certAndKey);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
-----BEGIN CERTIFICATE-----
MIICGzCCAYSgAwIBAgIIWrt6xtmHPs4wDQYJKoZIhvcNAQEFBQAwMzExMC8GA1UE
AxMoMTAwOTEyMDcyNjg3OC5hcHBzLmdvb2dsZXVzZXJjb250ZW50LmNvbTAeFw0x
MjEyMDExNjEwNDRaFw0yMjExMjkxNjEwNDRaMDMxMTAvBgNVBAMTKDEwMDkxMjA3
MjY4NzguYXBwcy5nb29nbGV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