wazuh / wazuh-http-request

Wazuh HTTP request library
7 stars 6 forks source link

Adding the authentication options to the test tool #55

Closed pereyra-m closed 7 months ago

pereyra-m commented 7 months ago
Related issue
Closes wazuh/wazuh/issues/22532

Description

This PR adds some options to the test tool to properly connect with username/password and CA authentication

root@74a36f92d602:/# LD_LIBRARY_PATH=./ ./urlrequest_testtool --cacert /etc/filebeat/certs/root-ca.pem --cert /etc/filebeat/certs/filebeat.pem --key /etc/filebeat/certs/filebeat-key.pem --username admin --password admin -t get -u https://172.17.0.2:9200
{
  "name" : "node-2",
  "cluster_name" : "wazuh-cluster",
  "cluster_uuid" : "1OCvdXmLReGM-_2TpGekow",
  "version" : {
    "number" : "7.10.2",
    "build_type" : "rpm",
    "build_hash" : "eee49cb340edc6c4d489bcd9324dda571fc8dc03",
    "build_date" : "2023-09-20T23:54:29.889267151Z",
    "build_snapshot" : false,
    "lucene_version" : "9.7.0",
    "minimum_wire_compatibility_version" : "7.10.0",
    "minimum_index_compatibility_version" : "7.0.0"
  },
  "tagline" : "The OpenSearch Project: https://opensearch.org/"
}

Also, a flag to set different headers than default was included.