changeset 4563:7ec1845521ed icedtea-2.0-branchpoint

Add test to ensure HTTPS works (needs a populated cacerts).
author andrew
date Thu, 22 Sep 2011 01:56:22 +0100
parents 333e434c8cae
children b4d68c3df0ce
files test/java/net/URL/TestHttps.java
diffstat 1 files changed, 34 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/net/URL/TestHttps.java	Thu Sep 22 01:56:22 2011 +0100
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2010 Red Hat, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+
+/* @test
+ * @summary This test check if the cacerts keytool database is configured properly and SSL is really working. The test should not fail if SSL is working.
+ */
+
+import java.io.IOException;
+
+import java.net.URL;
+import java.net.URLConnection;
+
+public class TestHttps {
+    public static void main(String[] args) throws IOException {
+        new URL("https://www.verisign.com/").openConnection().connect();
+    }
+}