Tag Info

Hot answers tagged

20

Curl is using the system-default CA bundle is stored in /etc/pki/tls/certs/ca-bundle.crt . Before you change it, make a copy of that file so that you can restore the system default if you need to. You can simply append new CA certificates to that file, or you can replace the entire bundle. Are you also wondering where to get the certificates? I (and ...


14

curl already uses keepalive by default. As an example: curl -v http://www.google.com http://www.google.com Produces the following: * About to connect() to www.google.com port 80 (#0) * Trying 74.125.39.99... connected * Connected to www.google.com (74.125.39.99) port 80 (#0) > GET / HTTP/1.1 > User-Agent: curl/7.19.7 (x86_64-pc-linux-gnu) ...


13

It seems the difference has to do with the Content-Length header and how it is treated by both commands. But before going into that, curl -X HEAD does not give any output because, by default, curl does not print headers if switch -i is not provided (not needed on -I though). In any case, curl -I is the proper way to fetch the headers. It just ask for the ...


12

Yeah, you can do that, as curl --help would have told you: curl -k or curl --insecure


11

The error is fairly clear. Essentially what is happening is that the cert on the remote end is either self signed, or signed by an authority that wget isn't recognizing. You can pass the following command while invoking wget to get it to ignore cert errors: --no-check-certificate


11

You can use the -d option in curl with a @- argument to accept input from a pipe. You will need to construct the key-value pairs yourself. Try this: echo "time=`uptime`" | curl -d @- http://URL The backticks (`) denote that the enclosed command (in this case uptime) should be executed, and the backtick-quoted text replaced with the output of the executed ...


10

Your curl command is running as root (via sudo) but your php command is not. Try moving your sudo between the pipe ("|") and 'php' (assuming you want your installer to run as root in the first place...).


9

From what is mentioned in http://pecl.php.net/bugs/bug.php?id=17012&edit=1, pecl does not recognize php modules that were not statically compiled into php. So if you are using any shared libraries, pecl will ignore them. Pecl also ignores your php.ini. The good news is there are still two easy ways to install this if you have curl as a shared ...


9

No, cURL is not a standard part of operating systems. It isn't ever standard on all Linux based distributions.


9

Powershell. $wc = New-Object System.Net.WebClient $wc.DownloadFile($source, $dest) There's also Invoke-WebRequest in PS 3.0.


8

curl http://google.com > /path/to/dir/index.html


8

I was having this exact problem (today as well, found your post while searching for a result) The following worked for me: cd /Library/Caches/Homebrew curl -O http://fossies.org/unix/privat/pkg-config-0.27.tar.gz brew install imagemagick Basically Homebrew will not re-download a file that it has cached, so its just about downloading the file from ...


8

Think I found a solution going through the cURL manual: curl https:// DOMAIN.TLD --resolve 'DOMAIN.TLD:443:IP_ADDRESS'


7

You can also use the --insecure option to bypass SSL verification


7

install the package apt-get install php5-curl at this point php should already be configured to load that library [ /etc/php5/apache2/conf.d/curl.ini ]; restart apache /etc/init.d/apache2 restart


6

I think this is a bug in curl. If I specify a method with -X, curl should handle the response according to the RFC. Unfortunately, the maintainer of curl does not agree. Someone filed a bug and even submitted a patch: http://sourceforge.net/tracker/?func=detail&atid=100976&aid=1810273&group_id=976 but the curl maintainer rejected it. Apparently ...


6

Had a similar problem with Ubuntu 12.04 running curl from the command line to get aws command-line tools which were in github. I found if I ran the command-line as such: curl https://raw.github.com/timkay/aws/master/aws -o aws --cacert /etc/ssl/certs/ca-certificates.crt it would work. But trying to set the CURL_CA_BUNDLE environment variable so I could ...


6

Have a look at A.J. Clark's blog: xargs -P 20 -n 1 wget -nv <urs.txt


6

instead of using wget, curl works like this: curl --silent http://domain.com/cron.php which will work in the same way as wget. if its a php file you are launching, is there any reason you cant run it via the command line php interpreter like so: php -q /path/to/cron.php same on a webserver request and often will work much faster and without certain ...


6

curl -I will generate a HEAD request. Adding the -L option will make it follow redirects. Timeouts can be controlled with several options depending on which bit of the request you want to time out. From the man page: --connect-timeout <seconds> Maximum time in seconds that you allow the connection to the server to take. This only limits ...


6

Use '&' after a command to background a process, and 'wait' to wait for them to finish. Use '()' around the commands if you need to create a sub-shell. #!/bin/bash curl -s -o foo http://example.com/file1 && echo "done1" & curl -s -o bar http://example.com/file2 && echo "done2" & curl -s -o baz http://example.com/file3 ...


6

As @Zoredache points out, ssh relays the status of the remote command as its own exit status, so error detection works transparently over SSH. However, two important points require special consideration in your example. First, curl tends to be very lenient, treating many abnormal conditions as success. For example, curl ...


6

wget(1) works sequentally by default, and has this option built in: -i file --input-file=file Read URLs from a local or external file. If - is specified as file, URLs are read from the standard input. (Use ./- to read from a file literally named -.) If this function is used, no URLs need be present on the command line. If there are ...


5

curl -k curl -k https://scottlinux.com source: scottlinux.com/curl-ignore-ssl-certificate-warnings/


5

Using GNU Parallel http://www.gnu.org/software/parallel/ you can do: cat listfile.txt | parallel curl -O Not only does GNU Parallel deal nicely with special chars like ' " and space, you will also get the added benefit of downloading in parallel. Watch the intro video to GNU Parallel: http://www.youtube.com/watch?v=OpaiGYxkSuQ


5

[Pushing up from comments] Two options: Batch mode from text-based browsers such as links/lynx/w3m Use openssl s_client as noted here: Connecting to HTTPS with netcat (nc)


5

You can use tcpdump to sniff some packets on the server, something like this: # tcpdump -vv -s0 tcp port 80 -w /tmp/apache_outgoing.pcap and run your PHP script to see what happens. Is there any way to restrict it to a) Only POST data, You can sniff all and filter with http.request.method == POST in Wireshark. b) Only coming from 1.1.1.1 # ...


5

I saw a solution on Debian bug tracker. I figured I'd post a workaround for people to fix the python-pycurl package themselves. sudo apt-get install build-essential fakeroot dpkg-dev mkdir ~/python-pycurl-openssl cd ~/python-pycurl-openssl sudo apt-get source python-pycurl sudo apt-get build-dep python-pycurl sudo apt-get install libcurl4-openssl-dev ...


5

So it turns out that installing the ca-certificates package didn't install the one that I needed. I found this post about certificates being presented out of order. This seems to be the case with my request to sagepay. The solution ended up being to install another CA certificate from Verisign. I'm not sure why this fixes the issue with it being out of ...


5

Probably depends which version of Redhat. You can find which package actually updates the file by doing: rpm -qf /etc/pki/tls/certs/ca-bundle.crt My result was showing that openssl-0.9.8e-12.el5 needs to be updated. If there is no updated certificates in your distribution, you have to manually update, as per Nada's answer.



Only top voted, non community-wiki answers of a minimum length are eligible