Newman: "path must be a string" message using --ssl-client-cert flag

Created on 3 Apr 2017  ยท  4Comments  ยท  Source: postmanlabs/newman

Hi!, I'm using Newman v3 Cli, and I need to use ssl cert, but it doesnt work, and I don't know why.

  1. Newman Version: 3.5.2
  2. OS details (type, version, and architecture): Ubuntu 16.10 64bits
  3. Newman CLI
  4. My first time with this issue
  5. Request with ssl client cerificate
  6. newman run 'collections/mycollection.json' -d 'data/mydata.json' -e 'environments/rc.json' --ssl-client-cert mycert.pem
Newman Test

โ†’ Search
  GET <URL + Parametters sensible data> [200 OK, 18.18KB, 447ms]
  โ”Œ
  โ”‚ 'Validation failed: ', null
  โ””
  โœ“  Status code is 200
  โœ“  Content-Type is present
  โœ“  Valid response schema

โ†’ CreateTransactionInsurance copy
  POST <URL> [errored]
  โœ“  Status code is 200
  2. Content-Type is present

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌ
โ”‚                               โ”‚ executed โ”‚   failed โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผ
โ”‚              iterations  โ”‚       1        โ”‚        0   โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผ
โ”‚                requests โ”‚             2 โ”‚        1   โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผ
โ”‚            test-scripts โ”‚              2 โ”‚        0  โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผ
โ”‚      prerequest-scripts โ”‚         0 โ”‚        0  โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผ
โ”‚              assertions โ”‚              5 โ”‚        1  โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ด
โ”‚ total run duration:                     708ms    โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
โ”‚ total data received: 17.89KB (approx)     โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
โ”‚ average response time: 447ms               โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

failure                   detail                                                                                              

 1.  Error                     self signed certificate in certificate chain                                                        
                               at request                                                                                          
                               inside "CreateTransactionInsurance copy" of ""                                                      

 2.  AssertionFailure          Content-Type is present                                                                             
                               at assertion:2 in test-script                                                                       
                               inside "CreateTransactionInsurance copy" of ""     


How you can see, there are two request.
But when I try to use the --ssl-client-cert

The newman test shows only that One request was executed.
After the information table shows "path must be a string" message with no more information.

Newman Test

โ†’ Search
  GET <URL + Parametters sensible data> [200 OK, 18.18KB, 498ms]
  โ”Œ
  โ”‚ 'Validation failed: ', null
  โ””
  โœ“  Status code is 200
  โœ“  Content-Type is present
  โœ“  Valid response schema

โ†’ CreateTransactionInsurance copy

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌ
โ”‚                               โ”‚ executed โ”‚   failed โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผ
โ”‚              iterations โ”‚               0 โ”‚        0 โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผ
โ”‚                requests โ”‚               1 โ”‚        0 โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผ
โ”‚            test-scripts โ”‚               1 โ”‚        0 โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผ
โ”‚      prerequest-scripts โ”‚          0 โ”‚        0 โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผ
โ”‚              assertions โ”‚               3 โ”‚        0 โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ด
โ”‚ total run duration: 0ms                           โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
โ”‚ total data received: 17.89KB (approx)    โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
โ”‚ average response time: 498ms              โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
path must be a string

I really don't know what is happening, I need some help. I'm new using postman api and newman cli.
Thanks, and sorry for create an issue.

Most helpful comment

@estebancoria Your issue (self signed certificate in chain...) can be resolved by including the -k CLI argument in your newman run command (which will disable SSL certificate validation). The final command would be:

newman run 'collections/mycollection.json' -d 'data/mydata.json' -e 'environments/rc.json' --ssl-client-cert mycert.pem -k

Feel free to get back to us if you're facing difficulties ๐Ÿ˜„

All 4 comments

@estebancoria Your issue (self signed certificate in chain...) can be resolved by including the -k CLI argument in your newman run command (which will disable SSL certificate validation). The final command would be:

newman run 'collections/mycollection.json' -d 'data/mydata.json' -e 'environments/rc.json' --ssl-client-cert mycert.pem -k

Feel free to get back to us if you're facing difficulties ๐Ÿ˜„

@kunagpal thanks a lot. And sorry.

@estebancoria No worries. Have fun developing with Postman and Newman!

I have pfx certificate so how to deal with it @kunagpal it shows me 'certificate "cert" load error:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AlphaWong picture AlphaWong  ยท  3Comments

vijaygroovey picture vijaygroovey  ยท  3Comments

DotNetRockStar picture DotNetRockStar  ยท  5Comments

gaieges picture gaieges  ยท  4Comments

Schveitzer picture Schveitzer  ยท  4Comments