new: Allow cert-based auth

pull/7/head
Hannah Ward 2017-04-07 10:22:05 +01:00
parent f71827b555
commit 7739699737
No known key found for this signature in database
GPG Key ID: 6F3BAD60DE190290
2 changed files with 14 additions and 2 deletions

View File

@ -41,6 +41,12 @@ cat >> $CONFIGDIR/remote-servers.yml << EOF
auth:
username:
password:
cacert_path:
cert_file:
key_file:
key_password:
jwt_auth_url:
verify_ssl: True
collections:
- collection
EOF

View File

@ -73,8 +73,14 @@ for server in config:
version = server["taxii_version"],
headers = server["headers"])
cli.username = server["auth"]["username"]
cli.password = server["auth"]["password"]
cli.set_auth(username = server["auth"]["username"],
password = server["auth"]["password"],
ca_cert = server["auth"].get("ca_cert"),
cert_file= server["auth"].get("cert_file"),
key_file = server["auth"].get("key_file"),
key_password = server["auth"].get("key_password"),
jwt_auth_url = server["auth"].get("jwt_auth_url"),
verify_ssl = server["auth"].get("verify_ssl"))
for collection in server["collections"]:
for content_block in cli.poll(collection):