Chef cookbook upload error

Ihave installed chef workstation in my windows PC then I have have written a knife.rb file. Then i have fetch ssl certificate and then verified it using command knife ssl fetch and knife ssl check then bootstrapped two nodes. But when I am uploading my cookbook i a, getting error as follows:

ERROR: Connection refused connecting to https://chef-server-2-7584fbd778-kpgxm/bookshelf/organization-d0ac71e43164411966aa9f58be403925/checksum-b34def2b5927ee5cab9ff74f0028f917?AWSAccessKeyId=f6a39485eba392a6168c30004dcef1e74a845cb5&Expires=1560852089&Signature=WMq1ff5P/VmX/NdF/vt1DYijIIU%3D, retry 2/5

My chef server is ruuning in kubernetes. and accessible at https://chef-server-2-7584fbd778-kpgxm:31066. What to do?

What happens when you try to login to chef server via a web browser? Are you able to resolve the URL and then login to Chef server UI? If you don’t have the UI installed then try a curl command or try to do other things with knife like list data bags or cookbooks. Also would be great if you can post the full error output.

I am able to access my chef server via url 192.xxx.xx.12:31066
but when i am trying to upload cookbook it gives error stated above

You can turn off the ssl verification. Check for syntax. It is something like verify_ssl :false.

getting same error
ERROR: Connection refused connecting to https://chef-server-2-7584fbd778-kpgxm/bookshelf/organization-d0ac71e43164411966aa9f58be403925/checksum-07b69a0a9a5e7efee4e379fedc82189b?AWSAccessKeyId=f6a39485eba392a6168c30004dcef1e74a845cb5&Expires=1560970182&Signature=A4Xcrd6ECodi1DL8PTgNXyD3Oyk%3D, retry 3/5

Is there any way to give URL for uploading cookbook or change URL for uploading cookbook ?

Do you get an error when you run knife ssl check? If so, as mentioned above you can disable ssl. Also you can reference https://www.thegeekstuff.com/2016/06/knife-ssl-check-fetch/

No I don't get error while knife SSL check

Usually this error happen if there is a firewall in between your machine and chef server. Try to do tracert to the chef server from your machine. Also try out command like knife client list to check if the issue is with all knife commands.

other command works fine BUT i have figured out the error actually by default chef server uses port 443 for uloading cookbooks but my application is running on port 31066 so i am not able to upload cookbook. Unfortunately i cant change my port on which server is running so i am not able to resolve my issue