Layer 7 Mobile API Gateway: Unable to post to register_device: Hostname not verified


Article ID: 102811


Updated On:


CA Rapid App Security CA API Gateway


When using the Mobile SDK and launching an app the below error is received:

Unable to post to register_device: Hostname XXXXXXXX not verified: 

certificate: sha1/MMJ610v359r/3qXRqHG+LHezQAM= 
DN: 1.2.840.113549.1.9.1=#0c0e706970706f40706970706f2e6974,CN=camobile.gateway.local,O=CA Technolegies inc.,ST=USA,C=USA
subjectAltNames: [CAMobile.gateway.local,,, api.camobile.gateway.local] 


Component: APIMBL


For Android devices running Android 7 or high, you must make sure that Secure AMS has been enabled:

Optionally,  you can ignore the Hostname Verification during development, here is how to ignore Hostname Verification using the SDK: 

MAS.setConnectionListener(new MASConnectionListener() {
    public void onObtained(HttpURLConnection connection) {
        ((HttpsURLConnection) connection).setHostnameVerifier(new HostnameVerifier() {
            public boolean verify(String hostname, SSLSession session) {
                return true;

    public void onConnected(HttpURLConnection connection) {


Note: This could cause insecure network traffic due to trusting SSL/TLS server certificates for wrong hostnames, it is highly recommended to enable this for development purpose only but not production.