Hi,
Am trying to access an API, hosted by our team, using the following CURL command.
openssl pkcs12 -in iapi.fix.acp.aws.accenture.com.pfx -out certs.pem -nodes
curl --cacert certs.pem --key iapi.fix_priv.key --cert certs.pem:bpochp@123 -include -H "Accepts: application/json" -X GET https://iapi.fix.acp.aws.accenture.com/tenants -u admin:Password1
While this works fine off curl, am trying to replicate the same in powershell.
Can somebody help me please?
Have figured this out till here,
$cert=Get-PfxCertificate -FilePath iapi.fix.acp.aws.accenture.com.pfx
$user = "admin"
$pass = "Password1"
$pair = "$($user):$($pass)"
$bytes = [System.Text.Encoding]::ASCII.GetBytes($pair)
$base64 = [System.Convert]::ToBase64String($bytes)
$basicAuthValue = "Basic $base64"
$headers = @{ Authorization = $basicAuthValue }
$r=Invoke-WebRequest -uri "https://iapi.fix.acp.aws.accenture.com/tenants" -Headers $headers -Certificate $cert -CertificateThumbprint $cert.Thumbprint -ContentType application/json -Method Get
$r.Content
But an guessing am doing something wrong, as i end up in a could not connect to remote host error, can somebody also please tell me how to insert keys into a power shell cal?(--key iapi.fix_priv.key equivalent in PowerShell).
Any help here would be greatly appeciated!