Path: blob/master/test/jdk/javax/net/ssl/interop/ClientHelloChromeInterOp.java
41152 views
/*1* Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223//24// SunJSSE does not support dynamic system properties, no way to re-use25// system properties in samevm/agentvm mode.26//2728/*29* @test30* @bug 816936231* @summary Interop automated testing with Chrome32* @library /test/lib33* @modules jdk.crypto.ec34* java.base/sun.security.util35* @run main/othervm ClientHelloChromeInterOp36*/3738import java.util.Base64;39import jdk.test.lib.hexdump.HexPrinter;404142public class ClientHelloChromeInterOp extends ClientHelloInterOp {43// The ClientHello message.44//45// Captured from Chrome browser (version 54.0.2840.87 m (64-bit)) on46// Windows 10.47private final static String ClientHelloMsg =48"FgMBAL4BAAC6AwOWBEueOntnurZ+WAW0D9Qn2HpdzXLu0MgDjsD9e5JU6AAAIsA\n" +49"rwC/ALMAwzKnMqMwUzBPACcATwArAFACcAJ0ALwA1AAoBAABv/wEAAQAAAAATAB\n" +50"EAAA53d3cub3JhY2xlLmNvbQAXAAAAIwAAAA0AEgAQBgEGAwUBBQMEAQQDAgECA\n" +51"wAFAAUBAAAAAAASAAAAEAAOAAwCaDIIaHR0cC8xLjF1UAAAAAsAAgEAAAoACAAG\n" +52"AB0AFwAY";5354/*55* Main entry point for this test.56*/57public static void main(String args[]) throws Exception {58(new ClientHelloChromeInterOp()).run();59}6061@Override62protected byte[] createClientHelloMessage() {63byte[] bytes = Base64.getMimeDecoder().decode(ClientHelloMsg);6465// Dump the hex codes of the ClientHello message so that developers66// can easily check whether the message is captured correct or not.67System.out.println("The ClientHello message used");68try {69HexPrinter.simple().format(bytes);70} catch (Exception e) {71// ignore72}7374return bytes;75}76}777879