Not able to call adapter for iOS - ibm-mobilefirst

I am Using IBM Worklight Version 6.2.I made a hybrid application. I am able to make and deploy .apk file and is running fine. But when I Added Environment for iPhone. I imported that folder in X Code and run that project File. Application is running fine but I am not able to get the response from the Adapter. Below is the exception I am getting.
The Error is of 403 saying: establishSSLClientAuth isCertificateExists: false
My X-code version is 6.1
Kindly help me resolving this please
2016-05-17 12:40:42.277 mServe[683:138427] [DEBUG] [NONE] establishSSLClientAuth
2016-05-17 12:40:42.284 mServe[683:138394] [WARN] [USER_CERT_AUTH] +[WLUserAuthManager getCertificateIdentifier] in WLUserAuthManager.m:68 :: Certificate Identifier Key: com.worklight.userenrollment.certificate:com.mServe
2016-05-17 12:40:42.301 mServe[683:138394] THREAD WARNING: ['UserAuth'] took '17.668701' ms. Plugin should use a background thread.
2016-05-17 12:40:42.305 mServe[683:138477] [DEBUG] [NONE] Request [http://10.1.54.101:10080/Android/apps/services/api/mServe/iphone/query]
2016-05-17 12:40:42.310 mServe[683:138427] [DEBUG] [NONE] establishSSLClientAuth isCertificateExists: false
2016-05-17 12:40:42.488 mServe[683:138394] [ERROR] [WL_AFHTTPCLIENTWRAPPER_PACKAGE] -[WLAFHTTPClientWrapper requestFailed:error:] in WLAFHTTPClientWrapper.m:216 :: Request Failed
2016-05-17 12:40:42.494 mServe[683:138394] [ERROR] [WL_AFHTTPCLIENTWRAPPER_PACKAGE] -[WLAFHTTPClientWrapper requestFailed:error:] in WLAFHTTPClientWrapper.m:217 :: Response Status Code : 403
2016-05-17 12:40:42.500 mServe[683:138394] [ERROR] [WL_AFHTTPCLIENTWRAPPER_PACKAGE] -[WLAFHTTPClientWrapper requestFailed:error:] in WLAFHTTPClientWrapper.m:218 :: Response Error : Expected status code in (200-299), got 403

You are likely using iOS 9. iOS 9 by default uses a new security measure called ATS (Application Transport Security). During development you can disable it in order for network requests to pass successfully.
Please see here: https://mobilefirstplatform.ibmcloud.com/blog/2015/09/09/ats-and-bitcode-in-ios9/
Essentially you need to edit, in Xcode, the application's .plist file by adding the following:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>localhost</key>
<dict>
<!--Include to allow HTTP requests-->
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>

Related

SCM Manager returning 404 error when I try to restart scm from console

Goodevening Stackoverflow,
Today I upgraded scm from version 1.60 to 2.30 only that it returns a 404 error from Google console (the browser just keeps loading until the request times out).
running journalctl -u scm-server returning the following error:
Exception in thread "ScmEventBus-1-0" java.lang.UnsatisfiedLinkError: /tmp/jna6511840250923886855.tmp: /tmp/jna6511840250923886855.tmp: failed to map segment from shared object`
at java.lang.ClassLoader$NativeLibrary.load(Native Method)`
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1934)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1817)
at java.lang.Runtime.load0(Runtime.java:810)
at java.lang.System.load(System.java:1088)
at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:1018)
at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:988)
at com.sun.jna.Native.<clinit>(Native.java:195)
at com.sun.akuma.CLibrary.<clinit>(CLibrary.java:89)
at com.sun.akuma.JavaVMArguments.resolvePID(JavaVMArguments.java:128)
at com.sun.akuma.JavaVMArguments.ofLinux(JavaVMArguments.java:116)
at com.sun.akuma.JavaVMArguments.of(JavaVMArguments.java:104)
at com.sun.akuma.JavaVMArguments.current(JavaVMArguments.java:92)
at sonia.scm.lifecycle.PosixRestartStrategy.restart(PosixRestartStrategy.java:57)
at sonia.scm.lifecycle.PosixRestartStrategy.executeRestart(PosixRestartStrategy.java:47)
at sonia.scm.lifecycle.RestartStrategy.restart(RestartStrategy.java:67)
at sonia.scm.lifecycle.BootstrapContextFilter.handleRestartEvent(BootstrapContextFilter.java:99)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.github.legman.InvocationContext.invoke(InvocationContext.java:108)
at com.github.legman.InvocationContext.proceed(InvocationContext.java:101)
at com.github.legman.micrometer.MicrometerInvocationInterceptor.invoke(MicrometerInvocationInterceptor.java:47)
at com.github.legman.InvocationContext.proceed(InvocationContext.java:99)
at com.github.legman.EventHandler.handleEvent(EventHandler.java:103)
at com.github.legman.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:52)
at com.github.legman.EventBus.dispatchSynchronous(EventBus.java:452)
at com.github.legman.EventBus.lambda$dispatch$1(EventBus.java:444)
at org.apache.shiro.subject.support.SubjectRunnable.doRun(SubjectRunnable.java:120)
at org.apache.shiro.subject.support.SubjectRunnable.run(SubjectRunnable.java:108)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)`*
From google chrome console I get the following error:
GET http://serverip/scm/api/v2/ 404 (Not Found) ApiClient.request # apiclient.ts?718f:307
If I force restart from the server with service scm-server restart, scm manager returns up and running, and with the plugin installed.
Now it seems like the browser is finding it difficult to successfully restart SCM service even if in scm-manager.log I can see the jvm service was restarted.
I also checked the apache log error_log and found an error as follows:
[proxy:error] [pid 32822] (111)Connection refused: AH00957: HTTP: attempt to connect to 127.0.0.1:8080 (localhost) failed
[proxy_http:error] [pid 32822] [client 10.12.173.165:62193] AH01114: HTTP: failed to make connection to backend: localhost
[proxy:error] [pid 32821] (111)Connection refused: AH00957: HTTP: attempt to connect to 127.0.0.1:8080 (localhost) failed
The thing is with version 1.60 I never got any of these errors, the reverse proxy settings in httpd.conf works until this restart from console activity.
I really apologise for the long story, I am only trying to make it comprehensive as much as possibile.
Thanks to anyone willing to help a brother.
Regards
This problem occurs because your scm-manager restart accesses the tmp folder where it has no right to execute. This issue with jna is known by the SCM-Manager team and will be fixed soon.
As workaround try: After installation, run chmod -R 775 scm and scm should be able to restart service from browser

Not receiving telegram notification from zabbix

I have been using Zabbix for a while now. I tried to configure the telegram media type so as to receive notifications. Due to some error, I'm not receiving any notification. While testing the media type this is the error that appears on the log. Please help me resolve this.
Media type test log
00:00:00.000 [Debug] [Telegram Webhook] URL: https://api.telegram.org/bot/sendMessage
00:00:00.000 [Debug] [Telegram Webhook] params: {"chat_id":"-xyxyxyxyxy","text":"{ALERT.SUBJECT}\n{ALERT.MESSAGE}","disable_web_page_preview":true,"disable_notification":false}
00:00:05.183 [Debug] [Telegram Webhook] HTTP code: 200
00:00:05.184 [Debug] [Telegram Webhook] notification failed: TypeError: cannot read property 'ok' of null

user not registered in moid_verto

I have registered 2 extension in FreeSWITCH, I am able to logging in with both extension also. But, when I am trying to call one to another extension, I am getting error of USER_NOT_REGISTERED in fs log.
I am able to check status for both extension using verto_contact dialed_user#dialer_domain
2016-06-09 11:00:19.896037 [INFO] mod_dialplan_xml.c:635 Processing FreeSWITCH User <1002>->1000 in context default
Dialplan: verto.rtc/1000 parsing [default->1000] continue=false
Dialplan: verto.rtc/1000 Regex (PASS) [1000] destination_number(1000) =~ /^(\d+)$/ break=on-false
Dialplan: verto.rtc/1000 Action bridge(${verto_contact ${dialed_user}#${dialed_domain}})
2016-06-09 11:00:19.896037 [DEBUG] switch_core_state_machine.c:216 (verto.rtc/1000) State Change CS_ROUTING -> CS_EXECUTE
2016-06-09 11:00:19.896037 [DEBUG] switch_core_session.c:1397 Send signal verto.rtc/1000 [BREAK]
2016-06-09 11:00:19.896037 [DEBUG] switch_core_state_machine.c:528 (verto.rtc/1000) State ROUTING going to sleep
2016-06-09 11:00:19.896037 [DEBUG] switch_core_state_machine.c:472 (verto.rtc/1000) Running State Change CS_EXECUTE
2016-06-09 11:00:19.896037 [DEBUG] switch_core_state_machine.c:535 (verto.rtc/1000) State EXECUTE
2016-06-09 11:00:19.896037 [DEBUG] mod_rtc.c:120 verto.rtc/1000 RTC EXECUTE
2016-06-09 11:00:19.896037 [DEBUG] switch_core_state_machine.c:258 verto.rtc/1000 Standard EXECUTE
EXECUTE verto.rtc/1000 bridge(error/user_not_registered)
2016-06-09 11:00:19.896037 [DEBUG] switch_ivr_originate.c:2124 Parsing global variables
2016-06-09 11:00:19.896037 [NOTICE] switch_ivr_originate.c:2759 Cannot create outgoing channel of type [error] cause: [USER_NOT_REGISTERED]
2016-06-09 11:00:19.896037 [DEBUG] switch_ivr_originate.c:3747 Originate Resulted in Error Cause: 606 [USER_NOT_REGISTERED]
2016-06-09 11:00:19.896037 [INFO] mod_dptools.c:3276 Originate Failed. Cause: USER_NOT_REGISTERED
2016-06-09 11:00:19.896037 [NOTICE] switch_channel.c:4749 Hangup verto.rtc/1000 [CS_EXECUTE] [USER_NOT_REGISTERED]
My dialplan :
<include>
<extension name="1000">
<condition field="destination_number" expression="^(\d+)$">
<action application="bridge" data="${verto_contact ${dialed_user}#${dialed_domain}}"/>
</condition>
</extension>
</include>
I have also added this lines in default.xml which is required :
<param name="dial-string" value="{^^:sip_invite_domain=${dialed_domain}:presence_id=${dialed_user}#${dialed_domain}}${sofia_contact(*/${dialed_user}#${dialed_domain})},${verto_contact(${dialed_user}#${dialed_domain})}"/>
Am I doing anything wrong?
After long reviewer, I am able to solve this issue. There was issue in dialplan which I have created. It was not taking extension_number in verto_contact. So, I have made change of 1 line in dialplan.
Changed Dialplan :
<include>
<extension name="ext_call">
<condition field="destination_number" expression="^(\d+)$">
<action application="bridge" data="${verto_contact $1#X.X.X.X}"/>
</condition>
</extension>
</include>
Thanks.

How to use self signed (unpinned) certificate (SSL) with AFNetworking 2.6 and Swift 2.0 [duplicate]

I installed Xcode 7 and tried running my app under iOS 9.
I'm getting the infamous error: Connection failed! Error - -1200 An SSL error has occurred and a secure connection to the server cannot be made.
The thing is my server DOES support TLSv1.2 and I'm using NSURLSession.
What could be the problem then?
Apple has released the full requirements list for the App Transport Security.
Turned out that we were working with TLS v1.2 but were missing some of the other requirements.
Here's the full check list:
TLS requires at least version 1.2.
Connection ciphers are limited to those that provide forward secrecy (see below for the list of ciphers.)
The service requires a certificate using at least a SHA256 fingerprint with either a 2048 bit or greater RSA key, or a 256bit or greater Elliptic-Curve (ECC) key.
Invalid certificates result in a hard failure and no connection.
The accepted ciphers are:
TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
In iOS9, Apple added new feature called App Transport Security(ATS).
ATS enforces best practices during network calls, including the use of HTTPS.
Apple Pre-release documentation:
ATS prevents accidental disclosure, provides secure default behavior,
and is easy to adopt. You should adopt ATS as soon as possible,
regardless of whether you’re creating a new app or updating an
existing one.
If you’re developing a new app, you should use HTTPS exclusively. If
you have an existing app, you should use HTTPS as much as you can
right now, and create a plan for migrating the rest of your app as
soon as possible.
Add Below key in your info.plist & then see.
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
Even you can add specific exception,
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>testdomain.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<false/>
<key>NSExceptionAllowInsecureHTTPSLoads</key>
<false/>
<key>NSExceptionRequiresForwardSecrecy</key>
<true/>
<key>NSExceptionMinimumTLSVersion</key>
<string>TLSv1.2</string>
<key>NSThirdPartyExceptionAllowInsecureHTTPSLoads</key>
<false/>
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
<true/>
<key>NSThirdPartyExceptionMinimumTLSVersion</key>
<string>TLSv1.2</string>
<key>NSRequiresCertificateTransparency</key>
<false/>
</dict>
...
</dict>
</dict>
Check out this doc that apple provided.
I had a similar issue at runtime on iOS 9 and what I did to fix it was added the NSAppTransportSecurity Dictionary to my info.plist file with the NSAllowsArbitraryLoads Bool set to true and after cleaning and rebuilding it worked.
I hope this helps!
For me proxy was blocking try to use internet from different source will resolve issue.
Wifi, Lan, etc.
With iOS9, I had a same issue:
while SSLlab result showed no issues with protocols / ciphers on my server, a connection to one specific URL failed on an iPad running iOS/9.3.5 with an SSL-Error:
Connection cannot be established.
My stupid mistake was, that I had a redirect, i.e. in NGINX (and similar in Apache):
rewrite /calendar $scheme://www.example.org/resources/calendar;
If the user accessed /calender by setting:
https://example.org/calendar
the server redirected to another domain breaking the establishment of the SSL-connection.
Setting the redirect as follows fixed it:
rewrite /calendar $scheme://$server_name/resources/calendar;

The 'Rate Controlled' connection 'appm' access to protected services is denied

We are now deploying our application to production. But an issue of Rate Controlled show up? How can we solve this one? Any steps might solve this issue.The issue is connecting to *** using a adapter that uses a java.
We are getting the error from ipad device.
<Warning>: DEBUG: Submitting credentials to Worklight
<Warning>: DEBUG: Checking for authRequired attribute in responseJSON
<Warning>: DEBUG: authRequired attribute is present in responseJSON true
<Warning>: DEBUG: authrequired === true? true
<Warning>: DEBUG: authRequired is true, calling onShowLogin
<Warning>: DEBUG: do login [object Object]
<Error>: HID: The 'Rate Controlled' connection 'appme' access to protected services is denied.
<Warning>: void SendDelegateMessage(NSInvocation *): delegate (webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:) failed to return after waiting 10 seconds. main run loop mode: kCFRunLoopDefaultMode
<Warning>: ERROR: Failed to submit credentials to worklight
We are fetching credentials to ***. The adapter use jars and java classes to access the credentials.
Does not appear to be MobileFirst Platform-related.
Read through these threads, as it looks like you have some native code written by you here that is involved:
https://discussions.apple.com/thread/6074570
http://forums.coronalabs.com/topic/47830-hid-the-passive-connection-appname-access-to-protected-services-is-denied/
From these threads it seems that the real issue not the "HID ... access denied", but something else in your code that affects the network requests.
Note that you are also printing "[object object]"...
If this is working in the development environment but not in your production environment, then indeed you need to verify your network for anything potential who may cause delays or block requests.