OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.net; | 5 package org.chromium.net; |
6 | 6 |
7 import android.content.Context; | 7 import android.content.Context; |
8 import android.os.ConditionVariable; | 8 import android.os.ConditionVariable; |
9 | 9 |
10 import org.chromium.base.Log; | 10 import org.chromium.base.Log; |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
97 * @return url of a brotli-encoded server resource. | 97 * @return url of a brotli-encoded server resource. |
98 */ | 98 */ |
99 public static String getServeSimpleBrotliResponse() { | 99 public static String getServeSimpleBrotliResponse() { |
100 return getServerUrl() + Http2TestHandler.SERVE_SIMPLE_BROTLI_RESPONSE; | 100 return getServerUrl() + Http2TestHandler.SERVE_SIMPLE_BROTLI_RESPONSE; |
101 } | 101 } |
102 | 102 |
103 public static boolean startHttp2TestServer( | 103 public static boolean startHttp2TestServer( |
104 Context context, String certFileName, String keyFileName) throws Exc eption { | 104 Context context, String certFileName, String keyFileName) throws Exc eption { |
105 new Thread( | 105 new Thread( |
106 new Http2TestServerRunnable(new File(CertTestUtil.CERTS_DIRECTOR Y + certFileName), | 106 new Http2TestServerRunnable(new File(CertTestUtil.CERTS_DIRECTOR Y + certFileName), |
107 new File(CertTestUtil.CERTS_DIRECTORY + keyFileName))) | 107 new File(CertTestUtil.CERTS_DIRECTORY + keyFileName + ". pkcs8.pem"))) |
mef
2017/04/27 15:49:15
Is this new format needed because Netty doesn't li
kapishnikov
2017/04/27 16:40:09
Yes, netty requires PEM pkcs#8 format. It doesn't
| |
108 .start(); | 108 .start(); |
109 sBlock.block(); | 109 sBlock.block(); |
110 return true; | 110 return true; |
111 } | 111 } |
112 | 112 |
113 private Http2TestServer() {} | 113 private Http2TestServer() {} |
114 | 114 |
115 private static class Http2TestServerRunnable implements Runnable { | 115 private static class Http2TestServerRunnable implements Runnable { |
116 private final SslContext mSslCtx; | 116 private final SslContext mSslCtx; |
117 | 117 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
177 throws Exception { | 177 throws Exception { |
178 if (ApplicationProtocolNames.HTTP_2.equals(protocol)) { | 178 if (ApplicationProtocolNames.HTTP_2.equals(protocol)) { |
179 ctx.pipeline().addLast(new Http2TestHandler.Builder().build()); | 179 ctx.pipeline().addLast(new Http2TestHandler.Builder().build()); |
180 return; | 180 return; |
181 } | 181 } |
182 | 182 |
183 throw new IllegalStateException("unknown protocol: " + protocol); | 183 throw new IllegalStateException("unknown protocol: " + protocol); |
184 } | 184 } |
185 } | 185 } |
186 } | 186 } |
OLD | NEW |