GoogleCloudPlatform / android-docs-samples

Apache License 2.0
373 stars 594 forks source link

it have a influence on my api.ai #8

Closed qingdaofu1 closed 7 years ago

qingdaofu1 commented 7 years ago

Hi, i face a issue: i integrate the speech recognition with api.ai. when i use some speech recognition api like bing speech 、nuance or ibm, it can work fine. but when i use the google cloud speech api, thttps://github.com/api-ai/api-ai-android-sdk the google speech api use grpc, when i use this, my api.ai can't connect to api.ai service. will you offer some help . thanks; the log like below:

i.api.AIServiceException: Can't connect to the api.ai service. System.err: at ai.api.AIDataService.doTextRequest(AIDataService.java:389) System.err: at ai.api.AIDataService.request(AIDataService.java:147) System.err: at ai.api.AIDataService.request(AIDataService.java:117) System.err: at com.amyrobotics.amya_one.main.HardWakeMutualVoiceService$6.doInBackground(HardWakeMutualVoiceService.java:511) System.err: at com.amyrobotics.amya_one.main.HardWakeMutualVoiceService$6.doInBackground(HardWakeMutualVoiceService.java:506) System.err: at android.os.AsyncTask$2.call(AsyncTask.java:292) System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:237) System.err: at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231) System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) System.err: at java.lang.Thread.run(Thread.java:818) System.err: Caused by: javax.net.ssl.SSLHandshakeException: Handshake failed System.err: at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:390) System.err: at com.android.okhttp.Connection.upgradeToTls(Connection.java:201) System.err: at com.android.okhttp.Connection.connect(Connection.java:155) System.err: at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:276) System.err: at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:211) System.err: at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:382) System.err: at com.android.okhttp.internal.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:106) System.err: at com.android.okhttp.internal.http.DelegatingHttpsURLConnection.connect(DelegatingHttpsURLConnection.java:89) System.err: at com.android.okhttp.internal.http.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:25) System.err: at ai.api.AIDataService.doTextRequest(AIDataService.java:368) System.err: ... 10 more System.err: Caused by: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0xaf458600: Failure in SSL library, usually a protocol error System.err: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure (external/openssl/ssl/s23_clnt.c:770 0xac139001:0x00000000) System.err: at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method) System.err: at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:318) System.err: ... 19 more I/System.out: error messageis Can't connect to the api.ai service.

where the error occured is in the program below:

final AIRequest aiRequest = new AIRequest(text); new AsyncTask<AIRequest, Void, AIResponse>() { @Override protected AIResponse doInBackground(AIRequest... requests) {

i suspect the error is about the port "443", used in google cloud speech for "setAccessToken".

but i change the port of google speech to 442, it did't work, and google speech error. so i don't kown how to solve this, please help;

yaraki commented 7 years ago

The error seems irrelevant to Speech API. It is an error with SSL when you are connecting to the API.AI server.