Skip to content

Instantly share code, notes, and snippets.

@mhrivnak
Last active December 16, 2015 17:10
Show Gist options
  • Save mhrivnak/5468814 to your computer and use it in GitHub Desktop.
Save mhrivnak/5468814 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import logging
from pulp.common.download.config import DownloaderConfig
from pulp.common.download.request import DownloadRequest
from pulp.common.download.downloaders.event import HTTPEventletDownloader
logging.basicConfig()
requests = [DownloadRequest('https://cdn.redhat.com/content/dist/rhel/server/6/6Server/x86_64/os/repodata/repomd.xml', '/tmp/abc123')]
config = DownloaderConfig(
ssl_client_cert_path='/home/mhrivnak/8538048783306757070.pem',
ssl_client_key_path='/home/mhrivnak/8538048783306757070-key.pem',
ssl_validation=False,
)
downloader = HTTPEventletDownloader(config)
downloader.download(requests)
$ curl -I -k --cert /home/mhrivnak/8538048783306757070.pem --key /home/mhrivnak/8538048783306757070-key.pem https://cdn.redhat.com/content/dist/rhel/server/6/6Server/x86_64/os/repodata/repomd.xml
HTTP/1.1 200 OK
Server: Apache
ETag: "30ec42ba667f0a60b8438d5f52d35394:1366924363"
Last-Modified: Thu, 25 Apr 2013 21:06:59 GMT
Accept-Ranges: bytes
Content-Length: 3830
Content-Type: application/xml
Date: Fri, 26 Apr 2013 17:43:46 GMT
X-Cache: TCP_MEM_HIT from a69-8-201-75 (AkamaiGHost/6.11.2.2-10593690) (-)
Connection: keep-alive
X-Akamai-Request-ID: 4fc2f33c
@mhrivnak
Copy link
Author

Running the python script results in a 403, whereas doing the same with the curl utility in bash gives a 200.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment