[iOS9] 사이트 App Transport Security(ATS) Connection 체크

2017. 4. 21. 16:19개발자료/iOS


반응형

 

Mac에 설치된 nscurl 을 이용해서 체크가능하다.

Result : PASS/FAIL 로 결과가 나온다

 

# /usr/bin/nscurl --ats-diagnostics --verbose URL

 

## 정상일 경우

$  /usr/bin/nscurl --ats-diagnostics --verbose https://google.com

Starting ATS Diagnostics

 

Configuring ATS Info.plist keys and displaying the result of HTTPS loads to https://google.com.

A test will "PASS" if URLSession:task:didCompleteWithError: returns a nil error.

================================================================================

 

Default ATS Secure Connection

---

ATS Default Connection

ATS Dictionary:

{

}

Result : PASS

---

 

================================================================================

 

Allowing Arbitrary Loads

 

---

Allow All Loads

ATS Dictionary:

{

    NSAllowsArbitraryLoads = true;

}

Result : PASS

---

 

================================================================================

 

Configuring TLS exceptions for google.com

 

---

TLSv1.2

ATS Dictionary:

{

    NSExceptionDomains =     {

        "google.com" =         {

            NSExceptionMinimumTLSVersion = "TLSv1.2";

        };

    };

}

Result : PASS

---

 

---

TLSv1.1

ATS Dictionary:

{

    NSExceptionDomains =     {

        "google.com" =         {

            NSExceptionMinimumTLSVersion = "TLSv1.1";

        };

    };

}

Result : PASS

---

 

---

TLSv1.0

ATS Dictionary:

{

    NSExceptionDomains =     {

        "google.com" =         {

            NSExceptionMinimumTLSVersion = "TLSv1.0";

        };

    };

}

Result : PASS

---

 

================================================================================

 

Configuring PFS exceptions for google.com

 

---

Disabling Perfect Forward Secrecy

ATS Dictionary:

{

    NSExceptionDomains =     {

        "google.com" =         {

            NSExceptionRequiresForwardSecrecy = false;

        };

    };

}

Result : PASS

---

 

================================================================================

 

Configuring PFS exceptions and allowing insecure HTTP for google.com

 

---

Disabling Perfect Forward Secrecy and Allowing Insecure HTTP

ATS Dictionary:

{

    NSExceptionDomains =     {

        "google.com" =         {

            NSExceptionAllowsInsecureHTTPLoads = true;

            NSExceptionRequiresForwardSecrecy = false;

        };

    };

}

Result : PASS

---

 

================================================================================

 

Configuring TLS exceptions with PFS disabled for google.com

 

---

TLSv1.2 with PFS disabled

ATS Dictionary:

{

    NSExceptionDomains =     {

        "google.com" =         {

            NSExceptionMinimumTLSVersion = "TLSv1.2";

            NSExceptionRequiresForwardSecrecy = false;

        };

    };

}

Result : PASS

---

 

---

TLSv1.1 with PFS disabled

ATS Dictionary:

{

    NSExceptionDomains =     {

        "google.com" =         {

            NSExceptionMinimumTLSVersion = "TLSv1.1";

            NSExceptionRequiresForwardSecrecy = false;

        };

    };

}

Result : PASS

---

 

---

TLSv1.0 with PFS disabled

ATS Dictionary:

{

    NSExceptionDomains =     {

        "google.com" =         {

            NSExceptionMinimumTLSVersion = "TLSv1.0";

            NSExceptionRequiresForwardSecrecy = false;

        };

    };

}

Result : PASS

---

 

================================================================================

 

Configuring TLS exceptions with PFS disabled and insecure HTTP allowed for google.com

 

---

TLSv1.2 with PFS disabled and insecure HTTP allowed

ATS Dictionary:

{

    NSExceptionDomains =     {

        "google.com" =         {

            NSExceptionAllowsInsecureHTTPLoads = true;

            NSExceptionMinimumTLSVersion = "TLSv1.2";

            NSExceptionRequiresForwardSecrecy = false;

        };

    };

}

Result : PASS

---

 

---

TLSv1.1 with PFS disabled and insecure HTTP allowed

ATS Dictionary:

{

    NSExceptionDomains =     {

        "google.com" =         {

            NSExceptionAllowsInsecureHTTPLoads = true;

            NSExceptionMinimumTLSVersion = "TLSv1.1";

            NSExceptionRequiresForwardSecrecy = false;

        };

    };

}

Result : PASS

---

 

---

TLSv1.0 with PFS disabled and insecure HTTP allowed

ATS Dictionary:

{

    NSExceptionDomains =     {

        "google.com" =         {

            NSExceptionAllowsInsecureHTTPLoads = true;

            NSExceptionMinimumTLSVersion = "TLSv1.0";

            NSExceptionRequiresForwardSecrecy = false;

        };

    };

}

Result : PASS

---

 

 

================================================================================

 

## Error ##

Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made." UserInfo={_kCFStreamErrorCodeKey=-9824, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, NSUnderlyingError=0x10d20a1f0 {Error Domain=kCFErrorDomainCFNetwork Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made." UserInfo={NSErrorFailingURLStringKey=https://xxxx.xxxx.co.kr/x/x/x/x.jsp, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFNetworkCFStreamSSLErrorOriginalValue=-9824, _kCFStreamPropertySSLClientCertificateState=0, NSLocalizedDescription=An SSL error has occurred and a secure connection to the server cannot be made., _kCFStreamErrorDomainKey=3, NSErrorFailingURLKey=https://xxxx.xxxx.co.kr/x/x/x/x.jsp, _kCFStreamErrorCodeKey=-9824}}, NSLocalizedDescription=An SSL error has occurred and a secure connection to the server cannot be made., NSErrorFailingURLKey=https://xxxx.xxxx.co.kr/x/x/x/x.jsp, NSErrorFailingURLStringKey=https://xxxx.xxxx.co.kr/x/x/x/x.jsp, _kCFStreamErrorDomainKey=3}

 

 

 

 

 

반응형