# Unknown proxy scheme \`https'

**URL:** <https://discourse.chef.io/t/unknown-proxy-scheme-https/10604>\
**Category:** Chef Infra (archive)\
**Created:** [March 19, 2017, 6:37am UTC](https://discourse.chef.io/t/unknown-proxy-scheme-https/10604 "2017-03-19T06:37:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zebahmad](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/zebahmad/32/1780_2.png) [@zebahmad](https://discourse.chef.io/u/zebahmad)\
**Post date:** [March 19, 2017, 6:37am UTC](https://discourse.chef.io/t/unknown-proxy-scheme-https/10604/1 "2017-03-19T06:37:42Z")

</div>

Hi there,

I am setting up chef (chef client / chefDK on local workstation) for the first time. I am not able to run my knife commands due to some errors with https proxy. Sorry for the long post, I’m totally new to ruby/chef and wanted to provide any info that would be needed for triage.

I’m trying this from Mac.

**STACK TRACE**  
**_knife client list_**  
_mysystemname:chef-repo zahmad$ knife client list_  
ERROR: SSL Validation failure connecting to host: [api.chef.io](http://api.chef.io) - SSL\_connect returned=1 errno=0 state=error: certificate verify failed  
ERROR: Could not establish a secure connection to the server.  
Use `knife ssl check` to troubleshoot your SSL configuration.  
If your Chef Server uses a self-signed certificate, you can use  
`knife ssl fetch` to make knife trust the server’s certificates.

Original Exception: OpenSSL::SSL::SSLError: SSL Error connecting to - SSL\_connect returned=1 errno=0 state=error: certificate verify failed

With -VV parameter, the details error is shown as:  
ERROR: SSL Validation failure connecting to host: [api.chef.io](http://api.chef.io) - SSL\_connect returned=1 errno=0 state=error: certificate verify failed  
/opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31/lib/chef/http.rb:412:in `rescue in retrying_http_errors': SSL Error connecting to <remotechefserver> - SSL_connect returned=1 errno=0 state=error: certificate verify failed (OpenSSL::SSL::SSLError) from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31/lib/chef/http.rb:369:in`retrying\_http\_errors’  
from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31/lib/chef/http.rb:333:in `send\_http\_request’

_ **ssl check command** _  
So then I tried the ssl check command:  
_mysystemname:chef-repo zahmad$ knife ssl check -VV_  
INFO: Using configuration from /Users/zahmad/chef-repo/.chef/config.rb  
DEBUG: Checking SSL cert on   
Connecting to host [api.chef.io:443](http://api.chef.io:443)  
/opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/proxifier-1.0.3/lib/proxifier.rb:20:in `rescue in Proxy': unknown proxy scheme`https’ (ArgumentError)  
from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/proxifier-1.0.3/lib/proxifier.rb:17:in `Proxy' from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31/lib/chef/mixin/proxified_socket.rb:34:in`proxified\_socket’  
from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31/lib/chef/knife/ssl\_check.rb:80:in `verify_peer_socket' from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31/lib/chef/knife/ssl_check.rb:130:in`verify\_cert’  
from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31/lib/chef/knife/ssl\_check.rb:249:in `run' from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31/lib/chef/knife.rb:443:in`block in run\_with\_pretty\_exceptions’  
from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31/lib/chef/local\_mode.rb:44:in `with_server_connectivity' from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31/lib/chef/knife.rb:442:in`run\_with\_pretty\_exceptions’  
from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31/lib/chef/knife.rb:219:in `run' from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31/lib/chef/application/knife.rb:156:in`run’  
from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31/bin/knife:25:in `<top (required)>' from /usr/local/bin/knife:57:in`load’  
from /usr/local/bin/knife:57:in `’

**My ENV variables**  
I have included below entries in my .bash\_profile:  
export http\_proxy="[http://myproxyserver:80](http://myproxyserver:80)"  
export http\_proxy\_user "zahmad"  
export http\_proxy\_pass "mypassword"  
export https\_proxy="[https://myproxyserver:443](https://myproxyserver:443)"  
export https\_proxy\_user "zahmad"  
export https\_proxy\_pass "mypassword"  
I also tried removing https:// http:// also, but each time the error is “unknown proxy scheme `https'" or "unknown proxy scheme`myproxyserver’”.

If I give IP in the ENV variable without http:// or https:// the error is:  
DEBUG: Checking SSL cert on   
Connecting to host [api.chef.io:443](http://api.chef.io:443)  
/opt/chefdk/embedded/lib/ruby/2.3.0/uri/rfc3986\_parser.rb:67:in `split': bad URI(is not URI?): <myipaddress>:443 (URI::InvalidURIError) from /opt/chefdk/embedded/lib/ruby/2.3.0/uri/rfc3986_parser.rb:73:in`parse’  
from /opt/chefdk/embedded/lib/ruby/2.3.0/uri/common.rb:227:in `parse’

**My chef version**  
WM-C02RP194G8WP:/ zahmad$ chef --version  
Chef Development Kit Version: 1.2.22  
chef-client version: 12.18.31

**My chef configs**  
I tried adding proxy configs to config.rb but it seems to be getting picked from ENV and not the config.rb. So have removed all proxy configs in here.

Kindly help!

Regards,  
Zeba

---

<div class="post-metadata">

**Author:** ![zebahmad](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/zebahmad/32/1780_2.png) [@zebahmad](https://discourse.chef.io/u/zebahmad)\
**Post date:** [March 19, 2017, 1:33pm UTC](https://discourse.chef.io/t/unknown-proxy-scheme-https/10604/2 "2017-03-19T13:33:38Z")

</div>

Figured out the solution for this. It seems proxifier.rb dynamically looks for a class with name formed by prepending the “scheme”. In my case, it was looking for HTTPSProxy, whereas the proxifier’s proxy list only contained HTTPProxy class (from http.rb)  
/opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/proxifier-1.0.3/lib/proxifier/proxies/http.rb

The solution was to replace in my ENV properties,  
export https\_proxy=" **https** ://myproxy:443"  
with  
export https\_proxy=“ **http** ://myproxy:443”
