API v8 connection refused when authenticating

Hi all,

I’ve been following along with this documentation API v8 and am trying to setup a client with ‘Client Credentials’, but when trying to generate the access token I keep running into a

curl: (7) Failed to connect to port 443: Connection refused

I’ve rebuilt the .htaccess file before and after creating this entry - anyone familiar with using SuiteCRM API? I can’t find much about it in forums. Also, the port is open on my dev server

after a little fiddling around I believe that it is reaching the API, but now the error is:

curl: (35) schannel: next InitializeSecurityContext failed: SEC_E_INVALID_TOKEN (0x80090308) - The token supplied to the function is invalid

double checked my ID and secret key, so that shouldn’t be an issue I don’t think
This is my curl command I’m using to try to authenticate

curl -i -H “Accept: application/vnd.api+json” -H “Content-Type:application/vnd.api+json” -X POST --data “{‘grant_type’ : ‘client_credentials’, ‘client_id’ : ‘my id’, ‘client_secret’ : ‘my secret’}” https://10.140.10.10/SuiteCRM/Api/access_token

put curl into verbose mode and this is the output:

  • Trying 10.140.10.10…
  • TCP_NODELAY set
  • Connected to 10.140.10.10 (10.140.10.10) port 443 (#0)
  • schannel: SSL/TLS connection with 10.140.10.10 port 443 (step 1/3)
  • schannel: checking server certificate revocation
  • schannel: using IP address, SNI is not supported by OS.
  • schannel: sending initial handshake data: sending 156 bytes…
  • schannel: sent initial handshake data: sent 156 bytes
  • schannel: SSL/TLS connection with 10.140.10.10 port 443 (step 2/3)
  • schannel: failed to receive handshake, need more data
  • schannel: SSL/TLS connection with 10.140.10.10 port 443 (step 2/3)
  • schannel: encrypted data got 483
  • schannel: encrypted data buffer: offset 483 length 4096
  • schannel: next InitializeSecurityContext failed: SEC_E_INVALID_TOKEN (0x80090308) - The token supplied to the function is invalid
  • Closing connection 0
  • schannel: shutting down SSL/TLS connection with 10.140.10.10 port 443
  • schannel: clear security context handle
    curl: (35) schannel: next InitializeSecurityContext failed: SEC_E_INVALID_TOKEN (0x80090308) - The token supplied to the function is invalid

I found that this is probably an SSL error, I set apache to default to ssl and restarted the service. Now I get untrusted root errors from Curl. I used the -k flag to try to force insecure mode and now receive a 404. I’m currently on localhost if that changes anything