• BlackBerry Dynamics
  • Runtime library for Android applications
  • 12.0.1.79
AllowAllHostnameVerifier Class Reference

The ALLOW_ALL HostnameVerifier essentially turns hostname verification off. More...

Inheritance diagram for AllowAllHostnameVerifier:
AbstractVerifier X509HostnameVerifier

Description

This implementation is a no-op, and never throws the SSLException.

Author
Julius Davies

Notice

The following notice applies to the original API on which this API is based, and to its documentation. The documentation of this API has been revised from the original.

/*
 * Copyright (C) 2006 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

Public Member Functions

final void verify (final String host, final String[] cns, final String[] subjectAlts)
 Checks to see if the supplied hostname matches any of the supplied CNs or "DNS" Subject-Alts. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from AbstractVerifier
static String[] getDNSSubjectAlts (X509Certificate cert)
 Extracts the array of SubjectAlt DNS names from an X509Certificate. More...
 
static int countDots (final String s)
 Counts the number of dots "." in a string. More...
 

Member Function Documentation

◆ verify()

final void verify ( final String  host,
final String[]  cns,
final String[]  subjectAlts 
)

Most implementations only look at the first CN, and ignore any additional CNs. Most implementations do look at all of the "DNS" Subject-Alts. The CNs or Subject-Alts may contain wildcards according to RFC 2818.

Parameters
cnsCN fields, in order, as extracted from the X.509 certificate.
subjectAltsSubject-Alt fields of type 2 ("DNS"), as extracted from the X.509 certificate.
hostThe hostname to verify.
Exceptions
SSLExceptionIf verification failed.

Implements X509HostnameVerifier.