SSL not available in watson-developer-cloud example microphone-speech-to-text.py - python-2.7

Hello i try to get the following example running:
microphone-speech-to-text
I run this python script on Gentoo Linux device with a Python 2.7.6.
The device is connected to the internet via a mobile Hotspot from my mobile phone.
Unfortunately it does not work and get the following output:
Enter CTRL+C to end recording...
Error received: SSL not available.
Connection closed
I ran the script on my windows and it worked fine.
SSL libs are installed:
ldconfig -p | grep ssl
vocon_ssl.so (libc6) => /opt/aldebaran/lib/vocon_ssl.so
libssl.so.1.0.0 (libc6) => /usr/lib/libssl.so.1.0.0
libssl.so (libc6) => /usr/lib/libssl.so
libgnutls-openssl.so.27 (libc6) => /usr/lib/libgnutls-openssl.so.27
libgnutls-openssl.so (libc6) => /usr/lib/libgnutls-openssl.so
libevent_openssl-2.0.so.5 (libc6) => /usr/lib/libevent_openssl-2.0.so.5
If i run another example (speech_to_text_v1)
I get the correct result from watson followed by:
Error received: SSL not available.
Does anybody have an idea what could be the issue here?
Thanks

I could get rid of the "SSL not available" error by
pip install backports.ssl-match-hostname
I got this hint from here.
Also here is mentioned that websocket_client depends on backports.ssl-match-hostname for Python 2.x
After installing the package i got:
Error received: _ssl.c:334: No root certificates specified for verification of other-side certificates.
This could be fixed temporarily by calling disable_SSL_verification() of SpeechToTextV1 before the processing.
To fix it in the long term an approach could be downgrading the websocket-client library to 0.47.0 link1 link2
Another approach to get rid of the "No root certificates specified" Error is setting the Environment variable WEBSOCKET_CLIENT_CA_BUNDLE that is checked by the websocket library.
e.g.
os.environ['WEBSOCKET_CLIENT_CA_BUNDLE'] = '/etc/ssl/certs/ca-certificates.crt'

If I were to hazard a guess it would be that your Gentoo Linux device hasn't been setup with the appropriate TLS / SSL libraries. As a test run a list models request through cURL on your device, as per the API documentation - https://cloud.ibm.com/apidocs/speech-to-text#list-models
curl -X GET -u "apikey:{apikey}" "https://stream.watsonplatform.net/speech-to-text/api/v1/models"
That is going over TLS so, if you can get that to work, you may have better luck with the python application.

Related

"TLS Handshake timeout" when installing aws-sdk-go package with go get

I am getting net/http: TLS handshake timeout when trying to install aws-sdk-go with go get.
go get -v github.com/aws/aws-sdk-go
go: downloading github.com/aws/aws-sdk-go v1.30.10
go get: github.com/aws/aws-sdk-go#v1.30.10: Get https://storage.googleapis.com/proxy-golang-org-prod/153044bb636484b4-github.com:aws:aws-sdk-go-v1.30.10.zip?Expires=1587550038&GoogleAccessId=gcs-urlsigner-prod%40golang-modproxy.iam.gserviceaccount.com&Signature=Py%2Fu6vp6bq%2F%2Bz57LXE4oUVTvCjAL08bnxnlWuHUh2FME7v89fzIz1%2FNOJ5kKsXCJV39OMJLsjF5j3457p1mZJsBZSgTjMnFbPbuVRHu%2FhKPFPmvVsLYvchvB7Va%2F%2BGcyYHhOsP0XMdSo3N8GjqltihMWfKML49RNOmqCrQT%2F0Qc1b%2BBhbz9iH88QNd9mSwYYQpr0kuAVOb3OGfyQGY11vrTHLWp5ammOH%2B6Xa7g5cpCMO91Ane8aOEYywc0oSsgvv4y32qp0G%2FGm18pDHzLq1o0OA7HEKUU59ACFpOsTyEhF0uECBoNfFpiBuOub%2BY%2FMhGzsojk1dW0vzmR0SOGxqg%3D%3D: net/http: TLS handshake timeout
I can install any other go packages without any trouble. And my colleagues (in different network) can install aws-sdk-go without any problem. But, I am continuously facing this problem. I have tried with two different laptops. I have also tried switching to 3G network instead of broadband but, no luck there too.
How can I troubleshoot this problem?

CURLE_UNSUPPORTED_PROTOCOL - ftp download fails

i use cURL (installed via vcpkg). Also openssl installed via vcpkg for a c++ project on VS 2019.
The problem:
CURLE_UNSUPPORTED_PROTOCOL = curl_easy_perform(curl);
I used this example:
https://curl.haxx.se/libcurl/c/ftpsget.html
with corrected connection and file data. The FTP server is filezilla. I checked the connection and file
download with filezilla client. All fine.
When i use the sample from link, i get the CURLE_UNSUPPORTED_PROTOCOL and in my FTP server i can't see
any connection try.
The error is described like this:
The URL you passed to libcurl used a protocol that this libcurl does not support..
Verbose information is:
* STATE: INIT => CONNECT handle 0x148090e0b38; line 1356 (connection #-5000)
* Protocol "ftp" not supported or disabled in libcurl
* Closing connection -1
* Expire cleared (transfer 0x148090e0b38)
I check the internet for the error message above and none of those i found solved my problem.
It seems not to be a format problem or problem related to wrong url .
So my question is, where can i enable this ? Do i need additional packages ? Or is the problem elsewhere ?
Many thanks
Mean while i figured out how to accomplish this using latest curl command line tool (version 7.68.0) on windows:
curl -u my_user:my_password --ftp-ssl ftp://my_ip/my_relative_path/my_file --insecure -o my_file
The file for download is on a server where a FileZilla FTP server is working. This server cyphers with a self created cert. The curl client only accepts this, when using flag:
--insecure
So far, i could not find the related options for my c++ curl. Perhaps it is not possible at all, because sources available through vcpkg are not (yet) up to date. But i want to stick with vcpkg. For me, this solutions: using command line tool instead, works fine.
One more hint, which is important: curl version 7.64.00 works NOT. You get error:
curl: (35) schannel: failed to receive handshake, SSL/TLS connection failed

How to fix distcc error

I'm trying to get distcc working between two machines CLIENT and SERVER I "think" I have it setup right but I am still getting this error
(dcc_build_somewhere) Warning: failed to distribute, running locally
instead
NOTHING is being compiled on the server.
My configuration is as follows
CLIENT = 192.168.0.14
SERVER = 192.168.0.15
/etc/default/distcc on SERVER
STARTDISTCC="true"
ALLOWEDNETS="192.168.0.0/24" // Also tried CLIENT IP here
LISTENER="192.168.0.15" // SERVER IP
NICE="10"
JOBS="16"
ZEROCONF="false"
client - yes I know that its set to only compile on the server currently
DISTCC_HOSTS="192.168.0.15"
/etc/distcc/host set to 192.168.0.15
$HOME/.distcc/host set to 192.168.0.15
command
make -jx CC=distcc
I have tried on different software repos to see if there was some problem with an individual repo but the problem persists no matter the package.
EDIT
The failed to distribute error is a client side error. Server side the log indicates
distccd[1046] (dcc_job_summary) client: 192.168.0.14:40732 COMPILE_ERROR exit:1 sig:0 core:0 ret:0 time:94ms gcc certs/system_keyring.c
I fixed this by upgrading my version of GCC. The client and Server are now running 5.x.
Check the log:
DISTCCD_OPTS="${DISTCCD_OPTS} --log-file /var/log/distccd.log"
In my case, my log said:
(dcc_warn_masquerade_whitelist) CRITICAL! /usr/local/lib/distcc not found. You must see up masquerade (see distcc(1)) to list whitelisted compilers or pass --enable-tcp-insecure. To set up masquerade automatically run update-distcc-symlinks.
So I had to run:
sudo update-distcc-symlinks
sudo ln -s /usr/lib/distcc /usr/local/lib/distcc # because I compiled from source

Trouble installing cPanel

I am trying to install the latest version of cPanel on a server running Centos 6.6 and it is failing here:
[20150129.112152] Testing if it's possible to install a simple RPM
[20150129.112152] Retrieving http://httpupdate.cpanel.net/RPM/rpm_is_working-1.0-0.noarch.rpm
[20150129.112152] Preparing... ##################################################
[20150129.112152] rpm_is_working ##################################################
[20150129.112152] Now removing the RPM
info [updatenow] upcp Notification => root#server.serveraddress.com via EMAIL [level => 1]
Cpanel::iContact: icontact /usr/sbin/sendmail is not executable by 0
[20150129.112152] W An attempt to up/downgrade to 11.46.2.4 was blocked. Please review blockers.
Can't exec "/usr/local/cpanel/scripts/cpanel_initial_install": No such file or directory at
/home/cPanelInstall/selfgz11290/install line 146.
2015-01-29 11:21:52 148 (FATAL): Failure to exec /usr/local/cpanel/scripts/cpanel_initial_install
Removing /root/installer.lock
Does anyone have any ideas? I am trying to install this on an AWS EC2 instance that is running Centos 6.6. I tried opening my security group so that all traffic is allowed and this did not help.
It may be resulted from the failure of downloading essential files. I solved this problem on my server simply by clear /etc/sysconfig/iptables and stop the iptables service by service iptables stop.
What's more, I also delete ~/.cpan/, ~/.cpanm/, ~/.cpcpan/ and ~/cPanelInstall.

Change Domain Problems

I have been trying to change the domain and have been running into issues. I hope someone can help me out here, I have documented the steps I went through below.
I requested the DNS resouuce from our dns admin team.
.mike-cf.company.com canonical name = mike-cf.company.com.
Name: mike-cf.company.com
Address: 10.52.88.123
I then installed with the -D switch:
bash < <(curl -s -k -B http ://raw.github.com/cloudfoundry/vcap/master/dev_setup/bin/vcap_dev_setup -D mike-cf.company.com)
I noticed that not all the config files in ~/cloudfoundry/.deployments/devbox/config changed, so I changed those using sed command:
$ cd ~/cloudfoundry/.deployments/devbox/config
$ sed -i 's/.vcap.me/.newdomain.com/g' *.yml
I restarted and things were looking good, I was able to run vmc target with no problem but I was not able to register a user.
$ vmc target http://api.mike-cf.company.com/
Successfully targeted to [http://api.mike-cf.company.com]
$ vmc register --email mike#company.com --passwd password
Creating New User: Error 100: Bad request
There was no entried in uaa.log only this in the cloud_controller.log
[2012-09-25 09:06:46.712110] cc - pid=20400 tid=8ee9 fid=4757 DEBUG -- ---> async\nrequest: post http://uaa.mike-cf.company.com/oauth/token\nheaders: {"content-type"=>"application/x-www-form-urlencoded", "accept"=>"application/json", "authorization"=>"Basic Y2xvdWRfY29udHJvbGxlcjpjbG91ZGNvbnRyb2xsZXJzZWNyZXQ="}\nbody: grant_type=client_credentials
[2012-09-25 09:06:46.718338] cc - pid=20400 tid=8ee9 fid=4757 DEBUG -- <---\nresponse: 404\nheaders: {"SERVER"=>"nginx", "DATE"=>"Tue, 25 Sep 2012 16:06:46 GMT", "CONTENT_TYPE"=>"text/html", "CONTENT_LENGTH"=>"162", "CONNECTION"=>"close"}\nbody: \r\n404 Not Foundhttp://uaa.mike-cf.company.com: 404 trace ["/home/mike/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/bundler/gems/uaa-dad29c9030f4/gem/lib/uaa/http.rb:56:in json_parse_reply'", "/home/mike/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/bundler/gems/uaa-dad29c9030f4/gem/lib/uaa/token_issuer.rb:157:inrequest_token'", "/home/mike/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/bundler/gems/uaa-dad29c9030f4/gem/lib/uaa/token_issuer.rb:128:in client_credentials_grant'", "/home/mike/cloudfoundry/cloud_controller/cloud_controller/app/models/uaa_token.rb:80:inaccess_token'", "/home/mike/cloudfoundry/cloud_controller/cloud_controller/app/models/uaa_token.rb:96:in user_account_instance'", "/home/mike/cloudfoundry/cloud_controller/cloud_controller/app/controllers/users_controller.rb:13:increate'", "/home/mike/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/actionpack-3.0.14/lib/action_controller/metal/implicit_render.rb:4:in send_action'", "/home/mike/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/actionpack-3.0.14/lib/abstract_controller/base.rb:150:inprocess_action'", "/home/mike/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/actionpack-3.0.14/lib/action_controller/metal/rendering.rb:11:in process_action'", "/home/mike/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/actionpack-3.0.14/lib/abstract_controller/callbacks.rb:18:inblock in process_action'", "/home/mike/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.14/lib/active_support/callbacks.rb:446:in `run_3844132275556875466__process_action_2824786929479189233_callbacks'"]
[2012-09-25 09:06:46.896386] cc_events - pid=20400 tid=8ee9 fid=4757 INFO -- [2012-09-25 09:06:46 -0700, :USER, "N/A", "POST:/users", "mike#company.com", :FAILED, "Bad request"]
I have found the problem, there seemed to be an issue with the vmc I was using. Once I downgraded VMC I am now able to connect.
gem uninstall vmc
gem install --version '= 0.3.18' vmc
Here is the thread that lead me to the answer
https://groups.google.com/a/cloudfoundry.org/forum/?fromgroups=#!topic/vcap-dev/enY2qKnSJWI
is it possible to see the content of the uaa config file? Make sure it has the correct IP address specified for the NATS message bus, the line should look something like this;
mbus: nats://nats:nats#192.168.1.10:4222/
If that IP address is incorrect, it needs to be changed. I take it the server it is installed on has a static IP address? was it assigned before you installed VCAP?