/
githubmirror
/
librepo
Обзор
Документация
Войти
/
githubmirror
/
librepo
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
examples/python/using_client_ssl_certificates.py
27 строк
873 B
Daniel Alley
Drop Python 2 support
25 дек 2020, 21:25
25 дек 2020, 21:25
a67a128
Код
Авторство
О чём код?
#!/usr/bin/env python3 """ librepo - download a package using client SSL certificate """ import librepo if __name__ == "__main__": h = librepo.Handle() h.setopt(librepo.LRO_REPOTYPE, librepo.LR_YUMREPO) h.setopt(librepo.LRO_URLS, ["https://my-ssl-repo/fedora/20/x86_64/os/"]) # The client certificate .pem file may include just the public certificate # or may include an entire certificate chain including # public key, private key, and root certificates. h.setopt(librepo.LRO_SSLCLIENTCERT, "/etc/pki/client.pem") # In case the .pem just contains the public key, set the private key h.setopt(librepo.LRO_SSLCLIENTKEY, "/etc/client.key") # Set the certificate authority h.setopt(librepo.LRO_SSLCACERT, "/etc/ca.pem") h.progressdata = "i2c-tools-eepromer" h.download("packages/i2c-tools-eepromer-24-1.x86_64.rpm")