test/jdk/java/net/httpclient/DigestEchoClientSSL.java
author dfuchs
Wed, 31 Jan 2018 16:18:41 +0000
branchhttp-client-branch
changeset 56054 352e845ae744
parent 56033 db102c5ca88a
child 56070 66a9c3185028
permissions -rw-r--r--
http-client-branch: honor legacy jdk.http.auth.* property when handling proxy-authorization
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
56033
db102c5ca88a http-client-branch: 8194729: Java 9's HttpClient doesn't allow custom 'Authorization' headers
dfuchs
parents:
diff changeset
     1
/*
db102c5ca88a http-client-branch: 8194729: Java 9's HttpClient doesn't allow custom 'Authorization' headers
dfuchs
parents:
diff changeset
     2
 * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
db102c5ca88a http-client-branch: 8194729: Java 9's HttpClient doesn't allow custom 'Authorization' headers
dfuchs
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
db102c5ca88a http-client-branch: 8194729: Java 9's HttpClient doesn't allow custom 'Authorization' headers
dfuchs
parents:
diff changeset
     4
 *
db102c5ca88a http-client-branch: 8194729: Java 9's HttpClient doesn't allow custom 'Authorization' headers
dfuchs
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
db102c5ca88a http-client-branch: 8194729: Java 9's HttpClient doesn't allow custom 'Authorization' headers
dfuchs
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
db102c5ca88a http-client-branch: 8194729: Java 9's HttpClient doesn't allow custom 'Authorization' headers
dfuchs
parents:
diff changeset
     7
 * published by the Free Software Foundation.
db102c5ca88a http-client-branch: 8194729: Java 9's HttpClient doesn't allow custom 'Authorization' headers
dfuchs
parents:
diff changeset
     8
 *
db102c5ca88a http-client-branch: 8194729: Java 9's HttpClient doesn't allow custom 'Authorization' headers
dfuchs
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
db102c5ca88a http-client-branch: 8194729: Java 9's HttpClient doesn't allow custom 'Authorization' headers
dfuchs
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
db102c5ca88a http-client-branch: 8194729: Java 9's HttpClient doesn't allow custom 'Authorization' headers
dfuchs
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
db102c5ca88a http-client-branch: 8194729: Java 9's HttpClient doesn't allow custom 'Authorization' headers
dfuchs
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
db102c5ca88a http-client-branch: 8194729: Java 9's HttpClient doesn't allow custom 'Authorization' headers
dfuchs
parents:
diff changeset
    13
 * accompanied this code).
db102c5ca88a http-client-branch: 8194729: Java 9's HttpClient doesn't allow custom 'Authorization' headers
dfuchs
parents:
diff changeset
    14
 *
db102c5ca88a http-client-branch: 8194729: Java 9's HttpClient doesn't allow custom 'Authorization' headers
dfuchs
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
db102c5ca88a http-client-branch: 8194729: Java 9's HttpClient doesn't allow custom 'Authorization' headers
dfuchs
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
db102c5ca88a http-client-branch: 8194729: Java 9's HttpClient doesn't allow custom 'Authorization' headers
dfuchs
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
db102c5ca88a http-client-branch: 8194729: Java 9's HttpClient doesn't allow custom 'Authorization' headers
dfuchs
parents:
diff changeset
    18
 *
db102c5ca88a http-client-branch: 8194729: Java 9's HttpClient doesn't allow custom 'Authorization' headers
dfuchs
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
db102c5ca88a http-client-branch: 8194729: Java 9's HttpClient doesn't allow custom 'Authorization' headers
dfuchs
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
db102c5ca88a http-client-branch: 8194729: Java 9's HttpClient doesn't allow custom 'Authorization' headers
dfuchs
parents:
diff changeset
    21
 * questions.
db102c5ca88a http-client-branch: 8194729: Java 9's HttpClient doesn't allow custom 'Authorization' headers
dfuchs
parents:
diff changeset
    22
 */
db102c5ca88a http-client-branch: 8194729: Java 9's HttpClient doesn't allow custom 'Authorization' headers
dfuchs
parents:
diff changeset
    23
db102c5ca88a http-client-branch: 8194729: Java 9's HttpClient doesn't allow custom 'Authorization' headers
dfuchs
parents:
diff changeset
    24
/**
db102c5ca88a http-client-branch: 8194729: Java 9's HttpClient doesn't allow custom 'Authorization' headers
dfuchs
parents:
diff changeset
    25
 * @test
db102c5ca88a http-client-branch: 8194729: Java 9's HttpClient doesn't allow custom 'Authorization' headers
dfuchs
parents:
diff changeset
    26
 * @bug 8087112
56054
352e845ae744 http-client-branch: honor legacy jdk.http.auth.* property when handling proxy-authorization
dfuchs
parents: 56033
diff changeset
    27
 * @summary this test verifies that a client may provides authorization
352e845ae744 http-client-branch: honor legacy jdk.http.auth.* property when handling proxy-authorization
dfuchs
parents: 56033
diff changeset
    28
 *          headers directly when connecting with a server over SSL.
56033
db102c5ca88a http-client-branch: 8194729: Java 9's HttpClient doesn't allow custom 'Authorization' headers
dfuchs
parents:
diff changeset
    29
 * @library /lib/testlibrary
db102c5ca88a http-client-branch: 8194729: Java 9's HttpClient doesn't allow custom 'Authorization' headers
dfuchs
parents:
diff changeset
    30
 * @build jdk.testlibrary.SimpleSSLContext DigestEchoServer DigestEchoClient DigestEchoClientSSL
db102c5ca88a http-client-branch: 8194729: Java 9's HttpClient doesn't allow custom 'Authorization' headers
dfuchs
parents:
diff changeset
    31
 * @modules jdk.incubator.httpclient
db102c5ca88a http-client-branch: 8194729: Java 9's HttpClient doesn't allow custom 'Authorization' headers
dfuchs
parents:
diff changeset
    32
 *          java.base/sun.net.www
56054
352e845ae744 http-client-branch: honor legacy jdk.http.auth.* property when handling proxy-authorization
dfuchs
parents: 56033
diff changeset
    33
 *          java.base/sun.net
56033
db102c5ca88a http-client-branch: 8194729: Java 9's HttpClient doesn't allow custom 'Authorization' headers
dfuchs
parents:
diff changeset
    34
 * @run main/othervm DigestEchoClientSSL SSL
56054
352e845ae744 http-client-branch: honor legacy jdk.http.auth.* property when handling proxy-authorization
dfuchs
parents: 56033
diff changeset
    35
 * @run main/othervm -Djdk.http.auth.proxying.disabledSchemes=
352e845ae744 http-client-branch: honor legacy jdk.http.auth.* property when handling proxy-authorization
dfuchs
parents: 56033
diff changeset
    36
 *                   -Djdk.http.auth.tunneling.disabledSchemes=
352e845ae744 http-client-branch: honor legacy jdk.http.auth.* property when handling proxy-authorization
dfuchs
parents: 56033
diff changeset
    37
 *                   DigestEchoClientSSL SSL PROXY
56033
db102c5ca88a http-client-branch: 8194729: Java 9's HttpClient doesn't allow custom 'Authorization' headers
dfuchs
parents:
diff changeset
    38
 */
db102c5ca88a http-client-branch: 8194729: Java 9's HttpClient doesn't allow custom 'Authorization' headers
dfuchs
parents:
diff changeset
    39
db102c5ca88a http-client-branch: 8194729: Java 9's HttpClient doesn't allow custom 'Authorization' headers
dfuchs
parents:
diff changeset
    40
public class DigestEchoClientSSL {
db102c5ca88a http-client-branch: 8194729: Java 9's HttpClient doesn't allow custom 'Authorization' headers
dfuchs
parents:
diff changeset
    41
    public static void main(String[] args) throws Exception {
db102c5ca88a http-client-branch: 8194729: Java 9's HttpClient doesn't allow custom 'Authorization' headers
dfuchs
parents:
diff changeset
    42
        assert "SSL".equals(args[0]);
db102c5ca88a http-client-branch: 8194729: Java 9's HttpClient doesn't allow custom 'Authorization' headers
dfuchs
parents:
diff changeset
    43
        DigestEchoClient.main(args);
db102c5ca88a http-client-branch: 8194729: Java 9's HttpClient doesn't allow custom 'Authorization' headers
dfuchs
parents:
diff changeset
    44
    }
db102c5ca88a http-client-branch: 8194729: Java 9's HttpClient doesn't allow custom 'Authorization' headers
dfuchs
parents:
diff changeset
    45
}