Submit_nrdp over HTTPS


#1

Hello!

NSClient++ version: NSClient++ 0.5.0.62 2016-09-14 x64

Trying run command in “test” mode: submit_nrdp address=https://nrdp.server:4343/nrdp_dir

Error (http?): cli UNKNOWN: Error: Failed to POST http://nrdp.server:4343 301:

Server-side error in ./ssl_access_log (http!): [31/Jan/2017:12:03:29 +0300] “POST /nrdp_dir HTTP/1.0” 301 320

What do I need to do to use HTTPS?


#2

Turned on debug (nscp test --log trace). Test command:

submit_nrdp address=https://nrdp.server:4343/nrdp_dir token=10-TestToken command=Test result=WARN message=Test

Output:

submit_nrdp address=https://nrdp.server:4343/nrdp_dir token=10-TestToken command=Test result=WARN message=Test

T nrdp Target configuration: address: https://nrdp.server:4343/nrdp_dir, timeout: 30, retry: 2, data: { retries: 3, token: 10-TestToken, } T nrdp Connecting tuo: protocol: https, host: nrdp.server:4343, port: 4343, path: /nrdp_dir, timeout: 30, token: 10-TestToken, sender: T nrdp Sending: < ?xml version=“1.0” encoding=“UTF-8”?> < checkresults> < checkresult type=“service”> < hostname>TestHost< /hostname> < servicename>Test< /servicename> < state>1< /state> < output>Test< /output> < /checkresult> < /checkresults>

L cli UNKNOWN: Error: Failed to POST http://nrdp.server:4343 301:

Maybe, I was wrong. HTTPS is used. Server-side error:

[31/Jan/2017:13:51:19 +0300] “POST /nrdp_dir HTTP/1.0” 301 320

When NRDP-checks from Linux are send to server:

[31/Jan/2017:13:55:01 +0300] “GET /nrdp_dir?token=10-TestToken&cmd=submitcheck&XMLDATA=%3C%3F…Fcheckresult%3E%3C%2Fcheckresults%3E HTTP/1.1” 200 171

What wrong in submit_nrdp args?


#3

Seems like it gets a redirect which I am pretty sure it wont follow, do you have some form of redirect login on th webserver?


#4

Sorry for any mistakes. English is not my native language

I can’t find any settings for redirection (no .htaccess or mod_rewrite options). System: CentOS release 6.6. Apache/2.2.15

Workaround: I moved virtual directory from “/nrdp_dir” to “/”. Not elegant, but it work’s. Notice: In this situation in nsclient.ini address parameter must contain “/” at the end, otherwise nscp will use default value for “path” variable ("/nrdp/server" will be added to url). Notice: “NSCP-0.5.0.65” is used. In this version parameter “token” can be used.

I tested nrdp with send_nrdp script for Linux and NCPA client for Windows, checked httpd service logs, and I found that every time, every query get 301 HTTP response first time, than nrdp_client resent data with 200 HTTP response.

Offtop: I create test virual directory: (add /etc/httpd/conf.d/30-test.conf with only string “alias /test /usr/local/test”), then restarted httpd service. Run command: curl -I https://localhost/test -k Output: HTTP/1.1 301 Moved Permanently Date: Fri, 03 Feb 2017 06:27:37 GMT Server: Apache/2.2.15 (CentOS) Location: https://localhost/test/ Connection: close Content-Type: text/html; charset=iso-8859-1

I have redirection to the same url. I don’t understand this.


#5

Pretty sure the problem is the:

As it wont follow that… I.e. where curl follows the redirect nsclient++ will not…