Open Uzzi opened 4 years ago
modify $api_key = false; working on SSL
Hello,
i have the Same Problem, but removing the api key and adding credentials , dont help, is the selfsigned certificate the problem?
`URL: "https://172.24.0.12/api" APP-ID: "nmaper" api-key: ""
Trying 172.24.0.12:443...
Connected to 172.24.0.12 (172.24.0.12) port 443 (#0)
ALPN, offering h2
ALPN, offering http/1.1
successfully set certificate verify locations:
CAfile: /etc/nginx/ssl/mozilla-extracted.pem
CApath: /etc/ssl/certs
SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
ALPN, server accepted to use http/1.1
Server certificate:
subject: CN=pphpipam.westerwald.local; C=DE; ST=Rehinland-Pfalz; L=Oberlahr; O=Yoga Vidya e.v. Westerwald; OU=Technik
start date: Feb 26 23:33:02 2023 GMT
expire date: Feb 23 23:33:02 2033 GMT
issuer: CN=internal-ca; C=DE; ST=Rehinland-Pfalz; L=Oberlahr; O=Yoga Vidya e.v. Westerwald; OU=Technik
SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway.
POST /api/nmaper/user/ HTTP/1.1 Host: 172.24.0.12 User-Agent: phpipam-api php class Accept: / Transfer-Encoding: chunked Content-Length: 0 Authorization: Basic YWRtaW46MWp6NHExMHh5 Content-Type: application/x-www-form-urlencoded Expect: 100-continue
Mark bundle as not supporting multiuse < HTTP/1.1 100 Continue
Signaling end of chunked upload via terminating chunk.
Mark bundle as not supporting multiuse < HTTP/1.1 401 Unauthorized < Server: nginx/1.18.0 < Date: Mon, 27 Feb 2023 23:59:20 GMT < Content-Type: application/json; charset=utf-8 < Transfer-Encoding: chunked < Connection: keep-alive < Expires: Thu, 19 Nov 1981 08:52:00 GMT < Set-Cookie: ipa_snvbh67=1ieflmkscc593vg0iash2dtrgm; expires=Tue, 28 Feb 2023 23:59:20 +0000; Max-Age=86400; path=/; SameSite=Lax; HttpOnly; < Location: /api//user/ < Cache-Control: no-cache < Pragma: no-cache < Vary: Accept-Encoding <
Connection #0 to host 172.24.0.12 left intact
Trying 172.24.0.12:443...
Connected to 172.24.0.12 (172.24.0.12) port 443 (#0)
ALPN, offering h2
ALPN, offering http/1.1
successfully set certificate verify locations:
CAfile: /etc/nginx/ssl/mozilla-extracted.pem
CApath: /etc/ssl/certs
SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
ALPN, server accepted to use http/1.1
Server certificate:
subject: CN=pphpipam.westerwald.local; C=DE; ST=Rehinland-Pfalz; L=Oberlahr; O=Yoga Vidya e.v. Westerwald; OU=Technik
start date: Feb 26 23:33:02 2023 GMT
expire date: Feb 23 23:33:02 2033 GMT
issuer: CN=internal-ca; C=DE; ST=Rehinland-Pfalz; L=Oberlahr; O=Yoga Vidya e.v. Westerwald; OU=Technik
SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway.
POST /api/nmaper/user/ HTTP/1.1 Host: 172.24.0.12 User-Agent: phpipam-api php class Accept: / Transfer-Encoding: chunked Content-Length: 0 Authorization: Basic YWRtaW46MWp6NHExMHh5 Content-Type: application/x-www-form-urlencoded Expect: 100-continue
Mark bundle as not supporting multiuse < HTTP/1.1 100 Continue
Signaling end of chunked upload via terminating chunk.
Mark bundle as not supporting multiuse < HTTP/1.1 401 Unauthorized < Server: nginx/1.18.0 < Date: Mon, 27 Feb 2023 23:59:20 GMT < Content-Type: application/json; charset=utf-8 < Transfer-Encoding: chunked < Connection: keep-alive < Expires: Thu, 19 Nov 1981 08:52:00 GMT < Set-Cookie: ipa_snvbh67=2brcg31v0bbcbj8egmlku9jltu; expires=Tue, 28 Feb 2023 23:59:20 +0000; Max-Age=86400; path=/; SameSite=Lax; HttpOnly; < Location: /api//user/ < Cache-Control: no-cache < Pragma: no-cache < Vary: Accept-Encoding <
Connection #0 to host 172.24.0.12 left intact Array ( [code] => 401 [success] => [message] => Unauthorized [time] => 0.001 ) `
I'm tring to execute api-example.php, thi si error: PHP Notice: Array to string conversion in /var/www/html/phpipam/functions/classes/class.phpipam-api.php on line 652 PHP Notice: Undefined variable: response_headers in /var/www/html/phpipam/functions/scripts/api-test.php on line 26 Array ( [code] => 401 [success] => [message] => Unauthorized [time] => 0.024 )
Can you help me? Regards