src/share/classes/javax/net/ssl/SSLPermission.java

Print this page


   1 /*
   2  * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  26 package javax.net.ssl;
  27 
  28 import java.security.*;
  29 
  30 /**
  31  * This class is for various network permissions.
  32  * An SSLPermission contains a name (also referred to as a "target name") but
  33  * no actions list; you either have the named permission
  34  * or you don't.
  35  * <P>
  36  * The target name is the name of the network permission (see below). The naming
  37  * convention follows the  hierarchical property naming convention.
  38  * Also, an asterisk
  39  * may appear at the end of the name, following a ".", or by itself, to
  40  * signify a wildcard match. For example: "foo.*" and "*" signify a wildcard
  41  * match, while "*foo" and "a*b" do not.
  42  * <P>
  43  * The following table lists all the possible SSLPermission target names,
  44  * and for each provides a description of what the permission allows
  45  * and a discussion of the risks of granting code the permission.
  46  * <P>
  47  *
  48  * <table border=1 cellpadding=5
  49  *  summary="permission name, what it allows, and associated risks">
  50  * <tr>
  51  * <th>Permission Target Name</th>
  52  * <th>What the Permission Allows</th>
  53  * <th>Risks of Allowing this Permission</th>
  54  * </tr>
  55  *
  56  * <tr>
  57  *   <td>setHostnameVerifier</td>
  58  *   <td>The ability to set a callback which can decide whether to
  59  * allow a mismatch between the host being connected to by
  60  * an HttpsURLConnection and the common name field in
  61  * server certificate.
  62  *  </td>
  63  *   <td>Malicious
  64  * code can set a verifier that monitors host names visited by
  65  * HttpsURLConnection requests or that allows server certificates
  66  * with invalid common names.


   1 /*
   2  * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  26 package javax.net.ssl;
  27 
  28 import java.security.*;
  29 
  30 /**
  31  * This class is for various network permissions.
  32  * An SSLPermission contains a name (also referred to as a "target name") but
  33  * no actions list; you either have the named permission
  34  * or you don't.
  35  * <P>
  36  * The target name is the name of the network permission (see below). The naming
  37  * convention follows the  hierarchical property naming convention.
  38  * Also, an asterisk
  39  * may appear at the end of the name, following a ".", or by itself, to
  40  * signify a wildcard match. For example: "foo.*" and "*" signify a wildcard
  41  * match, while "*foo" and "a*b" do not.
  42  * <P>
  43  * The following table lists all the possible SSLPermission target names,
  44  * and for each provides a description of what the permission allows
  45  * and a discussion of the risks of granting code the permission.

  46  *
  47  * <table border=1 cellpadding=5
  48  *  summary="permission name, what it allows, and associated risks">
  49  * <tr>
  50  * <th>Permission Target Name</th>
  51  * <th>What the Permission Allows</th>
  52  * <th>Risks of Allowing this Permission</th>
  53  * </tr>
  54  *
  55  * <tr>
  56  *   <td>setHostnameVerifier</td>
  57  *   <td>The ability to set a callback which can decide whether to
  58  * allow a mismatch between the host being connected to by
  59  * an HttpsURLConnection and the common name field in
  60  * server certificate.
  61  *  </td>
  62  *   <td>Malicious
  63  * code can set a verifier that monitors host names visited by
  64  * HttpsURLConnection requests or that allows server certificates
  65  * with invalid common names.