I'm having issues with NativeScript running iOS (either simulated or physical) communicating with my local server (either running on linux or on the same test deployment running on my MacBook) due to SSL issues. From the searching I've already done this is due to the app transport security blocking the request as it's an untrusted SSL connection. I've modified the file app/App_Resources/iOS/Info.plist to add the lines
`<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>CFBundleDevelopmentRegion</key>`
but it is still failing. The inner exception states
Error: The certificate for this server is invalid. You might be connecting to a server that is pretending to be “192.168.0.40” which could put your confidential information at risk.
These lines should resolve the issue as it allows for untrusted communication. It seems that they're getting ignored. Any ideas why this might be failing?
Here's the full stack trace...
`
(qrmobileapp) Created Activity ID: 0x96907, Description: Loading Preferences From System CFPrefsD
(CFNetwork) Faulting in NSHTTPCookieStorage singleton
(CFNetwork) Faulting in CFHTTPCookieStorage singleton
(CFNetwork) Creating default cookie storage with process/bundle identifier
(CFNetwork) TIC Enabling TLS [1:0x60400016a800]
(CFNetwork) TIC TCP Conn Start [1:0x60400016a800]
(CFNetwork) Task <D90CBCBA-DFC6-4299-AE58-50B49901D304>.<1> setting up Connection 1
(libnetwork.dylib) [com.apple.network:] [1 192.168.0.40:44321 stream, pid: 85993, url: https://192.168.0.40:44321/api/appuser/test, tls] start
(CFNetwork) TIC TLS Event [1:0x60400016a800]: 1, Pending(0)
(CFNetwork) TIC TLS Event [1:0x60400016a800]: 2, Pending(0)
(CFNetwork) TIC TLS Event [1:0x60400016a800]: 11, Pending(0)
(CFNetwork) TIC TLS Event [1:0x60400016a800]: 12, Pending(0)
(CFNetwork) TIC TLS Event [1:0x60400016a800]: 14, Pending(0)
(qrmobileapp) Created Activity ID: 0x96908, Description: SecTrustEvaluateIfNecessary
(Security) [com.apple.securityd:SecError] Trust evaluate failure: [leaf AnchorTrusted SSLHostname]
(CFNetwork) TIC TLS Trust Result [1:0x60400016a800]: 2
(CFNetwork) TIC SSL Trust Error [1:0x60400016a800]: 3:0
(CFNetwork) TIC TCP Conn Cancel [1:0x60400016a800]
(CFNetwork) NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813)
(CFNetwork) Task <D90CBCBA-DFC6-4299-AE58-50B49901D304>.<1> HTTP load failed (error code: -1202 [3:-9813])
(CFNetwork) Task <D90CBCBA-DFC6-4299-AE58-50B49901D304>.<1> finished with error - code: -1202
(libnetwork.dylib) [com.apple.network:] [1 192.168.0.40:44321 stream, pid: 85993, url: https://192.168.0.40:44321/api/appuser/test, tls] cancelled. Events:
(libnetwork.dylib) [com.apple.network:] 0.000s [1 D6B6A870-33A7-422C-B22F-782F5A933AAD 192.168.0.40:44321 socket-flow] path:start
(libnetwork.dylib) [com.apple.network:] 0.000s [1 D6B6A870-33A7-422C-B22F-782F5A933AAD 192.168.0.40:44321 socket-flow] path:satisfied
(libnetwork.dylib) [com.apple.network:] 0.010s [1 D6B6A870-33A7-422C-B22F-782F5A933AAD 192.168.0.40:44321 socket-flow] flow:start_connect
(libnetwork.dylib) [com.apple.network:] 0.014s [1 D6B6A870-33A7-422C-B22F-782F5A933AAD 192.168.0.40:44321 socket-flow] flow:finish_transport
(libnetwork.dylib) [com.apple.network:] 0.056s [1] path:cancel
(CFNetwork) TIC TCP Conn Destroyed [1:0x60400016a800]
(qrmobileapp) Created Activity ID: 0x96909, Description: SecTrustReportTLSAnalytics
(CFNetwork) TIC Enabling TLS [2:0x60c00016a380]
(CFNetwork) TIC TCP Conn Start [2:0x60c00016a380]
(CFNetwork) Task <A96EE6D0-30B8-4950-AC4C-DC1F9BD02E8F>.<2> setting up Connection 2
(libnetwork.dylib) [com.apple.network:] [2 192.168.0.40:44321 stream, pid: 85993, url: https://192.168.0.40:44321/api/appuser/getToken, tls] start
(qrmobileapp) Created Activity ID: 0x9690a, Description: send control actions
(CFNetwork) TIC TLS Event [2:0x60c00016a380]: 1, Pending(0)
CONSOLE ERROR file:///app/tns_modules/#angular/core/bundles/core.umd.js:1682:24: ERROR {
"headers": {
"normalizedNames": {},
"lazyUpdate": null,
"headers": {}
},
"status": 0,
"statusText": "Unknown Error",
"url": null,
"ok": false,
"name": "HttpErrorResponse",
"message": "Http failure response for (unknown url): 0 Unknown Error",
"error": {
"line": 1298,
"column": 38,
"sourceURL": "file:///app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js",
"originalStack": "ZoneAwareError#file:///app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:1298:38\nfile:///app/tns_modules/tns-core-modules/http/http-request/http-request.js:87:37\nUIApplicationMain#[native code]\nstart#file:///app/tns_modules/tns-core-modules/application/application.js:272:26\nrun#file:///app/tns_modules/tns-core-modules/application/application.js:300:10\nbootstrapNativeScriptApp#file:///app/tns_modules/nativescript-angular/platform-common.js:160:26\nbootstrapApp#fil`
Related
My MDM signing certificate is expired and I want to replace the already installed MDM profile("Not Verified") with updated ones.
I look at MDM-Protocol-Reference.pdf and used installProfile command for it. ("The profile may also be signed")
built installProfile request using: https://developer.apple.com/documentation/devicemanagement/install_a_profile
it works for unsigned profile (base64 encode unsigned profile).
but it didn't work for signed profile (base64 encode signed profile), received error status from the device.
and I'm able to install the new signed profile manually (using user interaction) on top of an existing profile.
Device error log:
Failed to parse profile data. Error: NSError:
Desc : Invalid Profile
US Desc: Invalid Profile
Domain : MCProfileErrorDomain
Code : 1000
Type : MCFatalError
I'm Hoping to find a solution for the error OR other way to update the "Not Verified" profile without user interaction.
Device full log:
default 10:07:00.034059 +0300 mdmd TIC Enabling TLS [1:0x105015240]
default 10:07:00.034108 +0300 mdmd TIC Enabling TLS [1:0x105015240]
default 10:07:00.034868 +0300 mdmd TIC TCP Conn Start [1:0x105015240]
default 10:07:00.034910 +0300 mdmd TIC TCP Conn Start [1:0x105015240]
default 10:07:00.036285 +0300 mdmd Task <83EBAB60-06B5-42EE-982A-43FA43E59CB9>.<1> setting up Connection 1
default 10:07:00.036327 +0300 mdmd Task <83EBAB60-06B5-42EE-982A-43FA43E59CB9>.<1> setting up Connection 1
default 10:07:00.036508 +0300 mdmd [1 <private> <private>] start
default 10:07:00.036464 +0300 mdmd [1 <private> <private>] start
default 10:07:00.070280 +0300 mdmd TIC TLS Event [1:0x105015240]: 11, Pending(0)
default 10:07:00.070323 +0300 mdmd TIC TLS Event [1:0x105015240]: 11, Pending(0)
default 10:07:00.175928 +0300 mdmd TIC TLS Trust Result [1:0x105015240]: 0
default 10:07:00.175979 +0300 mdmd TIC TLS Trust Result [1:0x105015240]: 0
default 10:07:00.178796 +0300 mdmd TIC TLS Event [1:0x105015240]: 13, Pending(0)
default 10:07:00.178839 +0300 mdmd TIC TLS Event [1:0x105015240]: 13, Pending(0)
default 10:07:00.195485 +0300 mdmd TIC TLS Event [1:0x105015240]: 20, Pending(0)
default 10:07:00.195528 +0300 mdmd TIC TLS Event [1:0x105015240]: 20, Pending(0)
default 10:07:00.197112 +0300 mdmd TIC TCP Conn Connected [1:0x105015240]: Err(16)
default 10:07:00.197166 +0300 mdmd TIC TCP Conn Connected [1:0x105015240]: Err(16)
default 10:07:00.197650 +0300 mdmd TIC TCP Conn Event [1:0x105015240]: 1
default 10:07:00.197693 +0300 mdmd TIC TCP Conn Event [1:0x105015240]: 1
default 10:07:00.197782 +0300 mdmd TIC TCP Conn Event [1:0x105015240]: 8
default 10:07:00.197739 +0300 mdmd TIC TCP Conn Event [1:0x105015240]: 8
default 10:07:00.197829 +0300 mdmd TIC TLS Handshake Complete [1:0x105015240]
default 10:07:00.197871 +0300 mdmd TIC TLS Handshake Complete [1:0x105015240]
default 10:07:00.203814 +0300 mdmd Task <83EBAB60-06B5-42EE-982A-43FA43E59CB9>.<1> now using Connection 1
default 10:07:00.203857 +0300 mdmd Task <83EBAB60-06B5-42EE-982A-43FA43E59CB9>.<1> now using Connection 1
default 10:07:00.204394 +0300 mdmd Task <83EBAB60-06B5-42EE-982A-43FA43E59CB9>.<1> sent request, body S
default 10:07:00.204453 +0300 mdmd Task <83EBAB60-06B5-42EE-982A-43FA43E59CB9>.<1> sent request, body S
default 10:07:18.530406 +0300 mdmd Task <83EBAB60-06B5-42EE-982A-43FA43E59CB9>.<1> received response, status 200 content U
default 10:07:18.530224 +0300 mdmd Task <83EBAB60-06B5-42EE-982A-43FA43E59CB9>.<1> received response, status 200 content U
default 10:07:18.532521 +0300 mdmd Task <83EBAB60-06B5-42EE-982A-43FA43E59CB9>.<1> response ended
default 10:07:18.532248 +0300 mdmd Task <83EBAB60-06B5-42EE-982A-43FA43E59CB9>.<1> response ended
default 10:07:18.534869 +0300 mdmd Transaction completed. Status: 200
default 10:07:18.535022 +0300 mdmd Transaction completed. Status: 200
default 10:07:18.535773 +0300 mdmd Starting power assertion: Request: (null)
default 10:07:18.535584 +0300 mdmd Starting power assertion: Request: (null)
default 10:07:18.540990 +0300 mdmd Attempting to perform MDM request: InstallProfile
default 10:07:18.541106 +0300 mdmd Attempting to perform MDM request: InstallProfile
default 10:07:18.572015 +0300 mdmd Loaded AccessibilityUtilities.framework
default 10:07:18.572117 +0300 mdmd Loaded AccessibilityUtilities.framework
default 10:07:18.583088 +0300 mdmd Loaded SetupAssistant.framework
default 10:07:18.583158 +0300 mdmd Loaded SetupAssistant.framework
default 10:07:18.585012 +0300 mdmd Loaded AssertionServices.framework
default 10:07:18.585143 +0300 mdmd Loaded AssertionServices.framework
default 10:07:18.585359 +0300 mdmd Loaded AssertionServices.framework
default 10:07:18.585427 +0300 mdmd Loaded AssertionServices.framework
default 10:07:18.588152 +0300 mdmd BKSApplicationStateMonitor 0x10510f970 dealloced without invalidate
default 10:07:18.588061 +0300 mdmd BKSApplicationStateMonitor 0x10510f970 dealloced without invalidate
default 10:07:18.588565 +0300 mdmd -[FMDFMIPManager isManagedLostModeActive]
default 10:07:18.588633 +0300 mdmd -[FMDFMIPManager isManagedLostModeActive]
default 10:07:18.599702 +0300 mdmd Failed to parse profile data. Error: NSError:
Desc : Invalid Profile
US Desc: Invalid Profile
Domain : MCProfileErrorDomain
Code : 1000
Type : MCFatalErrordefault 10:07:18.599793 +0300 mdmd Failed to parse profile data. Error: NSError:
Desc : Invalid Profile
US Desc: Invalid Profile
Domain : MCProfileErrorDomain
Code : 1000
Type : MCFatalErrordefault 10:07:18.599872 +0300 mdmd Command Status: Error
Error: NSError:
Desc : Invalid Profile
US Desc: Invalid Profile
Domain : MCProfileErrorDomain
Code : 1000
Type : MCFatalError
default 10:07:18.599924 +0300 mdmd Command Status: Error
Error: NSError:
Desc : Invalid Profile
US Desc: Invalid Profile
Domain : MCProfileErrorDomain
Code : 1000
Type : MCFatalError
default 10:07:18.599994 +0300 mdmd MCJQ 1 Enqueueing jobBlock 4, calling function -[MCMDMServer schedulePollingServerForCommandWithAssertion:]
default 10:07:18.600042 +0300 mdmd MCJQ 1 Enqueueing jobBlock 4, calling function -[MCMDMServer schedulePollingServerForCommandWithAssertion:]
default 10:07:18.600115 +0300 mdmd MCJQ 1 Job finished, calling function -[MCMDMServer connection:didReceiveMessageForTopic:userInfo:]_block_invoke_2
default 10:07:18.600185 +0300 mdmd MCJQ 1 Job finished, calling function -[MCMDMServer connection:didReceiveMessageForTopic:userInfo:]_block_invoke_2
default 10:07:18.600263 +0300 mdmd Ending power assertion: Request: (null)
default 10:07:18.600322 +0300 mdmd Ending power assertion: Request: (null)
default 10:07:18.600381 +0300 mdmd MCJQ 1 Dispatching to executionQueue jobBlock 4
default 10:07:18.600453 +0300 mdmd MCJQ 1 Dispatching to executionQueue jobBlock 4
default 10:07:18.600817 +0300 mdmd MCJQ 1 Executing jobBlock 4
default 10:07:18.600880 +0300 mdmd MCJQ 1 Executing jobBlock 4
I have ran into an issue with socket events not hitting the server. I have an application that uses SocketIO. The application works great when I use iOS Simulator. As soon as I try to run my app on a real device socket events are not hitting the server. This is the case in both localhost and the instance located on AWS.
When I press a button that should send a socket event to the server I get nothing in the console in Xcode. The only thing I can see is an initial error that seems to happen continuously as soon as the application is built and launched.
2019-01-30 07:12:38.533860-0800 Moder8[1033:191786] [] nw_socket_handle_socket_event [C512.1:1] Socket SO_ERROR [61: Connection refused]
2019-01-30 07:12:38.536864-0800 Moder8[1033:191786] [] nw_socket_connect [C512.2:1] connectx(7, [srcif=0, srcaddr=<NULL>, dstaddr=::1.8097], SAE_ASSOCID_ANY, 0, NULL, 0, NULL, SAE_CONNID_ANY) failed: [61: Connection refused]
2019-01-30 07:12:38.537119-0800 Moder8[1033:191786] [] nw_socket_connect [C512.2:1] connectx failed (fd 7) [61: Connection refused]
2019-01-30 07:12:38.537176-0800 Moder8[1033:191786] [] nw_socket_connect connectx failed (fd 7) [61: Connection refused]
2019-01-30 07:12:38.538112-0800 Moder8[1033:190902] [] nw_connection_get_connected_socket [C512] Client called nw_connection_get_connected_socket on unconnected nw_connection
2019-01-30 07:12:38.538230-0800 Moder8[1033:190902] TCP Conn 0x282234840 Failed : error 0:61 [61]
2019-01-30 07:12:40.115642-0800 Moder8[1033:191786] [] nw_socket_handle_socket_event [C513.1:1] Socket SO_ERROR [61: Connection refused]
2019-01-30 07:12:40.115716-0800 Moder8[1033:191786] [] nw_socket_handle_socket_event [C514.1:1] Socket SO_ERROR [61: Connection refused]
2019-01-30 07:12:40.116498-0800 Moder8[1033:191786] [] nw_socket_handle_socket_event [C513.2:1] Socket SO_ERROR [61: Connection refused]
2019-01-30 07:12:40.116561-0800 Moder8[1033:191786] [] nw_socket_handle_socket_event [C514.2:1] Socket SO_ERROR [61: Connection refused]
2019-01-30 07:12:40.116698-0800 Moder8[1033:190953] [] nw_connection_get_connected_socket [C513] Client called nw_connection_get_connected_socket on unconnected nw_connection
2019-01-30 07:12:40.116715-0800 Moder8[1033:190953] TCP Conn 0x28221d380 Failed : error 0:61 [61]
2019-01-30 07:12:40.116755-0800 Moder8[1033:190953] [] nw_connection_get_connected_socket [C514] Client called nw_connection_get_connected_socket on unconnected nw_connection
2019-01-30 07:12:40.116768-0800 Moder8[1033:190953] TCP Conn 0x28221d2c0 Failed : error 0:61 [61]
The reason I am skeptical as to whether this has anything to do with the problem is because I get this same error when I use the Simulator and the socket events reach the server just fine.
What I have done.
I have searched Google and have read many references to related stuff including:
React native socket io no events being emitted from client
Getting "socket.error: [Errno 61] Connection refused" python paramiko
https://medium.com/#hr.hseyin_80381/8-steps-to-get-rid-of-error-nw-connection-get-connected-socket-connection-has-no-connected-handler-1bf622ca2332
Can't connect to web socket react-native-meteor iOS
I almost feel like this is something ridiculously simple. I tried playing around with App Transport Security Settings but could not find anything that made a difference:
I figured out the problem. iOS requires you to use the Mac IP address when connecting to localhost. I forgot to add my socket url into the env config file so it was pointing at localhost which obviously will not work for the localhost server instance or the one on AWS.
I am trying to use audio call in app, But when I call from a device to other device, It does not connect with device and automatically disconnected with twilio Api. What is that problem occurred in app?
2018-11-21 10:43:32.226794+0530 AppName[243:9466] StartCallAction transaction request successful
2018-11-21 10:43:32.279094+0530 AppName[243:7164] providerDidBegin
2018-11-21 10:43:32.279737+0530 AppName[243:7164] provider:performStartCallAction:
WARNING: no real random source present!
2018-11-21 10:43:32.308053+0530 AppName[243:7164] [INFO Twilio] recreateMainTransport, Found valid IPv4 address: IPAddress
2018-11-21 10:43:32.309170+0530 AppName[243:9465] [INFO TVOMakeCallCommand] Call URI: sip:None#chunderm.gll.twilio.com;transport=tls
2018-11-21 10:43:32.722550+0530 AppName[243:7164] provider:didActivateAudioSession:
2018-11-21 10:43:38.396482+0530 AppName[243:9514] TIC TCP Conn Failed [72:0x15ef5ca50]: 1:61 Err(61)
2018-11-21 10:43:38.397055+0530 AppName[243:9514] Task <7129FEF4-4EBE-4AC5-9B34-5E0D002AE56F>.<1> HTTP load failed (error code: -1004 [1:61])
2018-11-21 10:43:38.399459+0530 AppName[243:9466] Task <7129FEF4-4EBE-4AC5-9B34-5E0D002AE56F>.<1> finished with error - code: -1004
2018-11-21 10:43:38.808257+0530 AppName[243:7164] Call failed to connect: Connection error (503).
VPN connection created successfully on iOS 10 and also API request executes successfully.
Also, VPN connection created successfully on iOS 11.3 and 11.4 but API request get failed and showing below error:
2018-06-06 15:50:42.366512+0800 myAPP[555:197322] [] nw_path_evaluator_request_nexus_and_stats NECP_CLIENT_ACTION_REQUEST_NEXUS_INSTANCE [65: No route to host]
2018-06-06 15:50:42.366629+0800 myAPP[555:197322] [] nw_endpoint_flow_setup_channel [33 192.168.0.1:8000 in_progress channel-flow (satisfied)] failed to request nexus instance: Error Domain=kNWErrorDomainPOSIX Code=65 "No route to host" UserInfo={NSDescription=No route to host}
2018-06-06 15:50:42.366734+0800 myAPP[555:197322] TIC TCP Conn Failed [18:0x1d0374580]: 1:65 Err(65)
2018-06-06 15:50:42.366808+0800 myAPP[555:197322] Task <2FDCE10C-8CB4-469D-AAE6-E9307A68069D>.<1> HTTP load failed (error code: -1004 [1:65])
2018-06-06 15:50:42.367049+0800 myAPP[555:197506] Task <2FDCE10C-8CB4-469D-AAE6-E9307A68069D>.<1> finished with error - code: -1004
Error-Optional(Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={NSUnderlyingError=0x1d0650f80
{Error Domain=kCFErrorDomainCFNetwork Code=-1004 "(null)" UserInfo={_kCFStreamErrorCodeKey=65, _kCFStreamErrorDomainKey=1}}
Thanks
use AFNetworking 3.1 post in iOS11 i got this:
2017-09-21 14:48:17.086770+0800 FlashPay[1861:756422] TIC TCP Conn Failed [6:0x1c016b7c0]: 3:-9834 Err(-9834)
2017-09-21 14:48:17.191937+0800 FlashPay[1861:756422] TIC TCP Conn Failed [7:0x1c41684c0]: 3:-9834 Err(-9834)
2017-09-21 14:48:17.286800+0800 FlashPay[1861:756889] TIC TCP Conn Failed [8:0x1c416ac80]: 3:-9834 Err(-9834)
2017-09-21 14:48:17.287057+0800 FlashPay[1861:756889] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9834)
2017-09-21 14:48:17.287108+0800 FlashPay[1861:756889] Task <6558B73B-719E-4A5B-B73B-43A01CE7B4A4>.<1> HTTP load failed (error code: -1205 [3:-9834])
2017-09-21 14:48:17.287513+0800 FlashPay[1861:756890] Task <6558B73B-719E-4A5B-B73B-43A01CE7B4A4>.<1> finished with error - code: -1205
YMTLoginViewController.m:102 login failed:Error Domain=NSURLErrorDomain Code=-1205 "server“meyserver.com”do not accept certificate。" UserInfo={NSURLErrorFailingURLPeerTrustErrorKey=<SecTrustRef: 0x1c0300630>,
_kCFStreamErrorDomainKey=3, _kCFStreamErrorCodeKey=-9834, NSUnderlyingError=0x1c4651970 {Error Domain=kCFErrorDomainCFNetwork Code=-1205 "(null)" UserInfo={_kCFNetworkCFStreamSSLErrorOriginalValue=-9834, kCFStreamPropertySSLPeerCertificates=(
"<cert(0x1568e8800) s: meyserver.com i: meyserver.com>"
), _kCFStreamPropertySSLClientCertificateState=2, kCFStreamPropertySSLPeerTrust=<SecTrustRef: 0x1c0300630>, _kCFStreamPropertySSLClientCertificates=(
"<SecIdentityRef: 0x1c4238ca0>",
"<cert(0x155ea5cd0) s: meyserver.com i: meyserver.com>"
),_kCFStreamErrorDomainKey=3, _kCFStreamErrorCodeKey=-9834}}, NSErrorPeerCertificateChainKey=(
"<cert(0x1568e8800) s: meyserver.com i: meyserver.com>"
), NSErrorClientCertificateChainKey=(
"<SecIdentityRef: 0x1c4238ca0>",
"<cert(0x155ea5cd0) s: meyserver.com i: meyserver.com>"
), NSLocalizedDescription=server“myserver.com”do not accept certificate, NSErrorFailingURLKey=https://myserver.com:5843/, NSErrorClientCertificateStateKey=2}
but it works well in iOS10 and iOS9.3, please help me.
iOS11 had some changes:support.apple.com/en-us/UT207828
My server did changes which based on this, then my code work well.