# AT command - error 922 using HTTPS server

**URL:** <https://forum.sierrawireless.com/t/at-command-error-922-using-https-server/27898>\
**Category:** HL78\
**Created:** [September 15, 2022, 8:32am UTC](https://forum.sierrawireless.com/t/at-command-error-922-using-https-server/27898 "2022-09-15T08:32:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yotaiso](https://avatars.discourse-cdn.com/v4/letter/y/b9bd4f/32.png) [@Yotaiso](https://forum.sierrawireless.com/u/Yotaiso)\
**Post date:** [September 15, 2022, 8:32am UTC](https://forum.sierrawireless.com/t/at-command-error-922-using-https-server/27898/1 "2022-09-15T08:32:33Z")

</div>

Hello,

I want to connect to an HTTPS server using AT commands, which I can do with a simple HTTP server.

The problem is that to connect to an HTTP server, I have to use `AT+KHTTPCFG=1,"www.exemple.com"` and for an HTTPS server `AT+KHTTPCFG=1,"www.example.com",443,2`.  
The problem with the latter is that every time I use `AT+KHTTPGET=1,"/"` I get an error code 907 (Generic error) and `AT+KHTTPPOST=1,,"/"`.I get an error code 922 (Error due to invalid state of session), I also get a `KHTTP_ERROR:1,5` for all commands that interact with the server.

Also, I have seen that the `AT+KCERTSTORE` command can be useful but when I use it, my program freeze.

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/jyijyi/32/4766_2.png) [@jyijyi](https://forum.sierrawireless.com/u/jyijyi)\
**Post date:** [September 15, 2022, 8:37am UTC](https://forum.sierrawireless.com/t/at-command-error-922-using-https-server/27898/2 "2022-09-15T08:37:31Z")

</div>

There should be no problem on using AT+KCERTSTORE:

> [@HL7802 AT+KCERTSTORE error](https://forum.sierrawireless.com/t/hl7802-at-kcertstore-error/23091/3):
>
> I was using hardware flow control. It seems that it needed both a CR and the KPATTERN at the end and it works fine but with AT+KCERTSTORE=0,1339,0 (not 1337) So this is inaccurate? thanks

---

<div class="post-metadata">

**Author:** ![Yotaiso](https://avatars.discourse-cdn.com/v4/letter/y/b9bd4f/32.png) [@Yotaiso](https://forum.sierrawireless.com/u/Yotaiso)\
**Post date:** [September 15, 2022, 9:22am UTC](https://forum.sierrawireless.com/t/at-command-error-922-using-https-server/27898/3 "2022-09-15T09:22:00Z")

</div>

Hi jyijyi  
For the ‘AT+KCERTSTORE’ command, I initialize it with just one parameter ‘AT+KCERTSTORE=0’.  
I am missing the number of bytes to read/write, thanks for the help.

But I still have my problem with errors!

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/jyijyi/32/4766_2.png) [@jyijyi](https://forum.sierrawireless.com/u/jyijyi)\
**Post date:** [September 15, 2022, 9:26am UTC](https://forum.sierrawireless.com/t/at-command-error-922-using-https-server/27898/4 "2022-09-15T09:26:57Z")

</div>

you can see here for successful case:

> [@Troubleshooting +CME ERROR: 921 during HTTPS POST on HL7800](https://forum.sierrawireless.com/t/troubleshooting-cme-error-921-during-https-post-on-hl7800/18717/2):
>
> Hi, AT+CGATT=0 OK AT+KCNXUP=1 OK +KCNX\_IND: 1,4,1 +KCNX\_IND: 1,2,1,2,30 AT+KHTTPCFG=1,“[api.sandbox.ewaypayments.com](http://api.sandbox.ewaypayments.com)”,443,2,0 +KHTTPCFG: 1 OK +KCNX\_IND: 1,4,1 +KCNX\_IND: 1,2,1,2,30 AT+KHTTPPOST=1,"/DirectPayment.json",1 +CME ERROR: 921 +KCNX\_IND: 1,4,1 +KCNX\_IND: 1,2,1,2,30 The HL7800 cannot bring up PDP connection after network detachment in your log file. It has not supported this behavior. So you should remove AT +CGATT=0 command. Here is result on my module: AT+KHTTPPOST=1…

---

<div class="post-metadata">

**Author:** ![Yotaiso](https://avatars.discourse-cdn.com/v4/letter/y/b9bd4f/32.png) [@Yotaiso](https://forum.sierrawireless.com/u/Yotaiso)\
**Post date:** [September 15, 2022, 9:43am UTC](https://forum.sierrawireless.com/t/at-command-error-922-using-https-server/27898/5 "2022-09-15T09:43:42Z")

</div>

I took a look, and it may help me solve some problem.  
I will try
