I can access my test Node site (http://18.220.168.1:8888) from a browser just fine.  However, when I attempt to cURL using PHP's cURL, I get:   Array (     [curl_error] =&gt; Failed to connect to 18.220.168.1 port 8888: Connection refused     [error_number] =&gt; 7 )   My cURL setup is:  $ch = curl_init($url);  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method); curl_setopt($ch, CURLOPT_POSTFIELDS, $data);                                                                   curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);  // Temporary for testing self-signed sites curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);  curl_setopt($ch, CURLOPT_HTTPHEADER, array(                                                                               'Content-Type: '.$data_type,                                                                                     'Content-Length: ' . strlen($data),     'Public-Key: ' . $pub_key,     'Private-Key: ' . $priv_key,     'Authorization: Bearer ' . $pub_key,)                                                                        );  $result = curl_exec($ch);   I am hosting on Amazon's EC2, and the ports are open (obviously since I can access it via my browser).  Any idea what I'm doing wrong here by chance?  Thanks  EDIT  I just tested with resteasy's tester, and it connected just fine.  So it has to be something either in the cURL request, or between the browsers.
18
This is a  about Connection Refused    We see a lot of questions to the effect      When I try to connect to a system I get a message      Connection refused      Why is this ?
101024
I'm trying to update to node 7.x through the terminal on my raspberry pi and I keep encountering this error. The command I'm using is:  sudo curl -sL https://deb.nodesource.com/setup_7.x | bash -   Running this command as root doesn't work so I tried to see if apt-get was being used by any other processes.   ps aux | grep apt pi        1295  0.0  0.1   4272  1848 pts/0    S+   06:24   0:00 grep --color=auto apt   This is all I get. Ultimately, (although it was initially advised not to do so), I tried removing the files and running the command again.  sudo rm /var/lib/apt/lists/lock &amp;&amp; sudo rm /var/lib/dpkg/lock   Now neither one of these files no longer exists and I still receive the same error when trying to use curl. I also tried to kill that one process and I still get the error.
24719
I'm trying to follow the  (on my Ubuntu 10.04 VM).  The first step is:  sudo add-apt-repository ppa:linaro-maintainers/toolchain   But when I run that I get:  Error reading https://launchpad.net/api/1.0/~linaro-maintainers/+archive/toolchain: &lt;urlopen error [Errno 110] Connection timed out&gt;   I'm guessing the problem is with my configuration for my employer's proxy server, particularly for HTTPS.  When I opened  in Firefox, I got "The connection has timed out".  I then went into Firefox Preferences -> Advanced -> Network -> Settings... and set HTTP Proxy to "gateway" and Port to 8080, and checked "Use this proxy server for all protocols".  Then the page loaded.  This supports my theory.  I've tried setting the http_proxy and https_proxy environment variables (both lower and upper case):  $ set | grep -i proxy HTTPS_PROXY=https://gateway:8080 HTTP_PROXY=http://gateway:8080 http_proxy=http://gateway:8080 https_proxy=https://gateway:8080   I also tried changing them to:  $ set | grep -i proxy HTTPS_PROXY=gateway:8080 HTTP_PROXY=gateway:8080 http_proxy=gateway:8080 https_proxy=gateway:8080   And I tried adding this second line to /etc/apt/apt.conf:  Acquire::http::proxy "http://gateway:8080/"; Acquire::https::proxy "https://gateway:8080/";   But I continue to get the same error.  How do I troubleshoot this?  Update: I followed the instructions in the  to  and got further:  $ sudo add-apt-repository ppa:linaro-maintainers/toolchain Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /etc/apt/secring.gpg --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver keyserver.ubuntu.com --recv 1DD749B890A6F66D050D985CF1FCBACA7BE1F97B gpg: requesting key 7BE1F97B from hkp server keyserver.ubuntu.com gpgkeys: HTTP fetch error 7: couldn't connect to host gpg: no valid OpenPGP data found. gpg: Total number processed: 0   I wonder if the "HTTP fetch error" means I also need to add "Defaults env_keep = http_proxy" to /etc/sudoers...  Update #2: I added:  Defaults env_keep="http_proxy" Defaults env_keep="https_proxy"   ...as in , but I still get the same "gpgkeys: HTTP fetch error 7: couldn't connect to host" error.  And this is curious:  $ sudo env | grep proxy https_proxy=https://gateway:8080   ...because http_proxy isn't there.  Any advice is appreciated.  Update #3: Since the host of my VM is a laptop, I took it home and tried there (with no proxies):  $ sudo add-apt-repository ppa:linaro-maintainers/toolchain Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /etc/apt/secring.gpg --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver keyserver.ubuntu.com --recv 1DD749B890A6F66D050D985CF1FCBACA7BE1F97B gpg: requesting key 7BE1F97B from hkp server keyserver.ubuntu.com gpg: key 7BE1F97B: public key "Launchpad Linaro Overlay PPA" imported gpg: Total number processed: 1 gpg:               imported: 1  (RSA: 1)   It worked.  So problem is related to proxy configuration.  But I suppose I have a workaround.
115735
I'm trying to test a patch for the  that involves disabling SSLv3 on my web server. In order to test this on a non-production environment first, I'm setting the SSLProtocol on a VirtualHost for a different test server. My config looks something like this:  &lt;VirtualHost *:443&gt;     SSLEngine On     SSLProtocol All -SSLv2 -SSLv3     ServerName test.mysite.com     # bunch of other stuff omitted &lt;/VirtualHost&gt;   However even after restarting apache my test site is still claimed to be vulnerable. Is this expected to work? I'm wondering if I have to set it in the global ssl config or whether there's something else subtle that's causing the setting not to take and/or work.
106720
So I am trying to get ssh working on my server. I can connect on my local network with the local ip address of the server perfectly fine. When I try to connect remotely (through a domain name that I set-up for the server, which I know works) I get this connection refused error:  ssh: connect to host bahhudson.mine.nu port 22: Connection refused   From the research I have done into the problem it looks like something is going wrong with my router. I have configured port-forwarding, but that's the only think I can think is causing the "Connection Refused" error... My router is a WRT120N and I have configured it for port-forwarding based on , which seems somewhat outdated since some of those images are not exactly like what my router settings look like, but I have tried multiple ways for setting the portforwarding up, and I know that forwarding for port 80 works because my server has HTTP access which is working...  Also VPN access was getting blocked in what I believe to be a similar way, so the solution to the SSH port 22 being blocked might also be similar to that of the VPN being blocked as well.  Any ideas?  Thanks!
58297
UPDATE: Since Area 51 is not supporting SSL yet. But the Area 51 link in the footer of Meta Stack Exchange site and in the Your Communities dropdown list contains https://, clicked from there it caused the insecure connection issue.   Actual post When I click the  link in the bottom of the , I received the insecure connection issue.  In Google Chrome:  In plain text:  Your connection is not private Attackers might be trying to steal your information from discuss.area51.stackexchange.com (for example, passwords, messages or credit cards). NET::ERR_CERT_COMMON_NAME_INVALID  In Mozilla Firefox:  In plain text:  Your connection is not secure The owner of discuss.area51.stackexchange.com has configured their website improperly. To protect your information from being stolen, Firefox has not connected to this website.
39135
I have a site at hostgator, using their "Business account". It's cheap, and comes with a private SSL cert. HOWEVER, their MySQL settings are such that any db connection goes stale fairly quickly, and then the hostgator staff try to convince you to use a VPS or dedicated server at multiple times the expense.  I'm creating and deploying WebAPIs, which can have a 'conversation' which exceeds 60 seconds. When this occurs, the db connection handle is stale, causing any db operations after my timeout to fail.  I'm in the process of implementing the following solution, but am curious if anyone else has solved this issue (where they can not modify their my.ini or my.cnf to give MySQL more resources) in a similar or completely different manner.  last part of a hook_update:  $ret = db_query( "UPDATE {my_table} set field1 = '%s', field2 = %d ... WHERE vid - %d", $node-&gt;field1, $node-&gt;field2, ... $node-&gt;vid ); if (!$ret) {        // get private storage directory for this node:        $cexStorage    = _cex_front_getCexStore();        $nodeFilesPath = DRUPALROOT.'/'.$cexStorage.'/'.$node-&gt;storeDir;        $fname         = $nodeFilesPath.'/recover.node';         $readyToWrite  = serialize( $node );        file_put_contents( $fname, $readyToWrite );        if (file_exists( $fname )) {          _dbgReport( 'seems to have worked!' );        }     }   Then this is called in my hook_form, right after I determine that node->nid is valid:  function _cex_front_recover_node( &amp;$node ) {   if (!isset($node-&gt;storeDir)) {      _dbgReport( '**************************** _cex_front_recover_node: no storeDir!!!' );      return;   }    // get private storage directory for this node:   $cexStorage    = _cex_front_getCexStore();   $nodeFilesPath = DRUPALROOT.'/'.$cexStorage.'/'.$node-&gt;storeDir;   $fname         = $nodeFilesPath.'/recover.node';   if (file_exists( $fname )) {     $recovered = file_get_contents( $fname );     if ($recovered) {       // no longer needed:       unlink( $fname );       $recoveredNode = unserialize( $recovered );       // restore the key values I need to proceed with this node:       $node-&gt;stage = $recoveredNode-&gt;stage;       $node-&gt;rnid  = $recoveredNode-&gt;rnid;       $node-&gt;iris  = $recoveredNode-&gt;iris;       cex_front_update( $node );     }     else {       _dbgReport( '********* failed to read "'.$fname.'"' );     }   } }   I'll be pairing the logic down to only store the key fields I need, but this works! Sure beats upgrading my server at 3x the expense. Anyone else doing something like this?
70727
I can't connect to  or  &mdash; the initial connection times out every time. I check this every week, and it worked fine last time, so it must be something pretty recent. (Further HTTPS deployment?)
114402
I'm trying to load a field value (machine name: field_theme_image) from a content of node value 3, in "page--front.tpl.php".  &lt;?php   $node=node_load(3);   print $node-&gt;field_theme_image[$node-&gt;language][0]['uri']; ?&gt;   Using the above code I'm not getting full URL value. Please see the image below. I can see the path value in Devel themer.
34119
I'm in kind of a tight spot right now. I wanted to know if someone has seen a HTML, or PHP web ssh client as both my company and school block everything besides port 80. I'm a control freak when it comes to my servers so yah. I have found things like gateone but here's specifically my issue.  I have access via port 80. I host websites on port 80 if my server. I can run PHP scripts via Apache. I cannot visit sites via encryption. I cannot change the ssh port (trust me, I've tried) I have root access to the server.  Any help or Ideas would be appreciated. If worse comes to worse, I can write my own in PHP.
32510
After creating a self-signed SSL certificate, I have configured my remote MySQL server to use them (and SSL is enabled)  I ssh into my remote server, and try connecting to its own mysqld using SSL (MySQL server is 5.5.25)..  mysql -u &lt;user&gt; -p --ssl=1 --ssl-cert=client.cert --ssl-key=client.key --ssl-ca=ca.cert Enter password:  ERROR 2026 (HY000): SSL connection error: error:00000001:lib(0):func(0):reason(1)   Ok, I remember reading theres some problem with connecting to the same server via SSL. So I download the client keys down to my local box, and test from there...  mysql -h &lt;server&gt; -u &lt;user&gt; -p --ssl=1 --ssl-cert=client.cert --ssl-key=client.key --ssl-ca=ca.cert  Enter password:  ERROR 2026 (HY000): SSL connection error   Its unclear what this "SSL connection error" error refers to, but if I omit the -ssl-ca, then I am able to connect using SSL..  mysql -h &lt;server&gt; -u &lt;user&gt; -p --ssl=1 --ssl-cert=client.cert --ssl-key=client.key  Enter password:  Welcome to the MySQL monitor.  Commands end with ; or \g. Your MySQL connection id is 37 Server version: 5.5.25 MySQL Community Server (GPL)   However, I believe that this is only encrypting the connection, and not actually verifying the validity of the cert (meaning I would be potentially vulnerable to man-in-middle attack)  The SSL certs are valid (albeit self signed), and do not have a passphrase on them. So my question is, what am I doing wrong? How can I connect via SSL, using a self signed certificate?   MySQL Server version is 5.5.25 and the server and clients are CentOS 5.  Thanks for any advice  Edit: Note that in all cases, the command is being issued from the same directory where the ssl keys reside (hence no absolute path)  Edit (in response to mgorven):  ca.cert is the Certificate Authority certificate, which is supposed to tell mysql that my certificate authority is trusted.  The config from my.cnf is   [mysqld] ssl-ca=/etc/ssl/mysql/ca.cert ssl-cert=/etc/ssl/mysql/server.cert ssl-key=/etc/ssl/mysql/server.key   I also tried adding ssl-cipher=DHE-RSA-AES256-SHA but have since removed it as it didn't help.
56052
I tried to setup apache 2.2 in amazon aws using amazon ami. i did installed httpd and php and congirue http.conf to use /var/www/html.  Then put file index.html on that folder. But when i tried to use browser to browse my domain which is ec2-122-248-255-181.ap-southeast-1.compute.amazonaws.com, nothing was loaded.  I did start httpd by running apachectl start, and i can see it listening on port 80.  Does anybody know what is wrong?
82803
In my Ubuntu's /etc/mysql/my.conf, I have:  bind-address = 192.168.2.20  # My external IP   It works fine from remote, but when I want to connect locally,  says: java.net.ConnectException: Connection refused at com.mysql.jdbc.StandardSocketFactory.connect.  So when I want to work locally, I change my.cnf to:  bind-address = 0.0.0.0   And it starts working locally, but then it doesn't work from remote anymore.  How to make MySQL accesible both from remote AND local?
53846
I set up a micro instance (Ubuntu, 32 bit) and assigned an elastic IP (23.23.245.104)  Public DNS: ec2-23-23-245-104.compute-1.amazonaws.com  I successfully ssh'ed to the machine and installed nginx.  Then I edited the server_name attribute in nginx's config file (/etc/nginx/sites-available/default)  server_name ec2-23-23-245-104.compute-1.amazonaws.com;   Restarted nginx and hit  but got a "could not connect" error.  What did I forget to do?  Thanks
122218
Clicking on  doesn't connect me with the meta S.Ex.SE site.  EDIT: For some entry points, . Observation courtesy Gilles.  I consider it a pity that the devs have not paid attention to this issue nor have indicated that they noted the problem. While HTTPS is not yet official on this network, I refrain from using unencrypted connections. I can't participate in metas, oh well.  EDIT #2 (2015-11-07) - with the switch to CloudFlare SSL the problem looks finally resolved.  EDIT #3 (2015-11-17) - still getting 403 Forbidden from CloudFlare. D'rats!..  EDIT #4 (2016-01-11) - We're still there. It's 2016 already... Starting a bounty.
95270
I am trying to Load test on the link:  and getting this error message:   Expected closing bracket for IPv6 address at index 28  Please could you help  Tuti
68785
I'm trying to set up OpenVPN to listen on port 443, and then pass all HTTPS traffic to Apache, by using the port-share option. Relevant config snippets are: OpenVPN local ${PUBLIC_IP} port 443 port-share localhost 443  Apache with SSL Listen localhost:443  My OpenVPN client connects just fine, but when opening the HTTPS enabled page, I get errors. Firefox says:  SSL received a record that exceeded the maximum permissible length. (Error code: ssl_error_rx_record_too_long)  Curl says  curl: (35) error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol  The request ends up on Apache, since I see in the error logs the following messages: [Wed Oct 06 01:10:20 2010] [error] [client 127.0.0.1] Invalid method in request \x16\x03\x01 [Wed Oct 06 01:11:04 2010] [error] [client 127.0.0.1] Invalid method in request \x16\x03\x01 [Wed Oct 06 01:11:51 2010] [error] [client 127.0.0.1] Invalid method in request \x16\x03\x01  The messages entry for a HTTPS connection is Oct  6 01:13:21 ns1 openvpn[20154]: Re-using SSL/TLS context Oct  6 01:13:21 ns1 openvpn[20154]: LZO compression initialized Oct  6 01:13:21 ns1 openvpn[20154]: Control Channel MTU parms [ L:1544 D:140 EF:40 EB:0 ET:0 EL:0 ] Oct  6 01:13:21 ns1 openvpn[20154]: Data Channel MTU parms [ L:1544 D:1450 EF:44 EB:135 ET:0 EL:0 AF:3/1 ] Oct  6 01:13:21 ns1 openvpn[20154]: Local Options hash (VER=V4): 'c0103fa8' Oct  6 01:13:21 ns1 openvpn[20154]: Expected Remote Options hash (VER=V4): '69109d17' Oct  6 01:13:21 ns1 openvpn[20154]: TCP connection established with ${CLIENT_IP}:56203 Oct  6 01:13:21 ns1 openvpn[20154]: TCPv4_SERVER link local: [undef] Oct  6 01:13:21 ns1 openvpn[20154]: TCPv4_SERVER link remote: ${CLIENT_IP}:56203 Oct  6 01:13:21 ns1 openvpn[20154]: ${CLIENT_IP}:56203 Non-OpenVPN client protocol detected Oct  6 01:13:21 ns1 openvpn[20154]: TCP/UDP: Closing socket  Using httpd-2.2.3-43.el5.centos and openvpn-2.1.1-2.el5 . What should I do to make port sharing work?  Update: Using port 443 port-share localhost 10443  and Listen localhost:10443  makes no difference.  Update 2 : some command output [root@ns1 ~]# openvpn --help | grep port-share --port-share host port : When run in TCP mode, proxy incoming HTTPS sessions [root@ns1 ~]# netstat -nltp | grep 443 tcp        0      0 127.0.0.1:10443             0.0.0.0:*                   LISTEN      20088/httpd          tcp        0      0 ${PUBLIC_IP}:443             0.0.0.0:*                   LISTEN      20066/openvpn