Simulation The provided Certificate Signing Request (CSR) is invalid

On Simulation
Getting The provided Certificate Signing Request (CSR) is invalid. ON Getting PCSID from the third API.

1 . Making CSR
2. Getting CSID Successfully (if My CSR is wrong it should show error in this step).
3. Submitting Compliance Invoices for Simplified Invoices and also done debit and credit note on same base64 decoded BinaryToken
4. When I want to generate PCSID by using request_id(getting from compliance) I m facing that error.

Dear @farhan06

Thanks for reaching out,

To provide comprehensive support as usual, Can I kindly ask you to share your CSR?

Thanks,
Ibrahem Daoud.

@idaoud MIICKDCCAc8CAQAwUjEQMA4GA1UEAwwHRUdTMS0xMzEbMBkGA1UECwwSQUJDIENvbXBhbnkgQnJhbmNoMRQwEgYDVQQKDAtBQkMgQ29tcGFueTELMAkGA1UEBhMCU0EwVjAQBgcqhkjOPQIBBgUrgQQACgNCAAT/8U20ULuntPHpaaQ4Zi0h/WgTEqKMUtPyRbvqNU7WN3wFDLdHOxmjs+ICs6bY6DNYASmEsPmKEISdTfnqz8DfoIIBHDCCARgGCSqGSIb3DQEJDjGCAQkwggEFMCMGCSsGAQQBgjcUAgQWDBRQUkVaQVRDQUNvZGUtU2lnbmluZzCB3QYDVR0RBIHVMIHSpIHPMIHMMT0wOwYDVQQEDDQxLUVjbGlja3N8Mi13ZWJ8My02ZjRkMjBlMC02YmZlLTRhODAtOTM4OS0xNzM4NzM2NTg5MR8wHQYKCZImiZPyLGQBAQwPMzExMTg0MjQzNTAwMDAzMQ0wCwYDVQQMDAQwMTAwMVAwTgYDVQQaDEc0MDk3IDY2MzEsIFNob3AgTm8uIDEwIEJ1aWxkaW5nIDMzMCBSb2FkIDM1IEJsb2NrIDU2MSBUb3duIEFMIEpBTkFCSVlBSDEJMAcGA1UEDwwAMAoGCCqGSM49BAMCA0cAMEQCIDHNGLSN0OiV3SGCIt6WExHiqkF91EPmmhcdn2oGAsVNAiA/zh8Id1YXgtyVIGmagDXWEq+9tKiyl7j5ffeg6MRlrw==

Dear @farhan06

Thanks for your collaboration,

Kindly Note that this was a known issue and it already resolved, If you are still facing the same response please share your config file or your .cnf file through the below mail.

SP mail: sp_support@zatca.gov.sa

Thanks,
Ibrahem Daoud.

@idaoud Email sent, please check. Also, if the issue is already resolved, why am I still getting it? If the CSR is incorrect, it should return an error on the first CSID check. This is also my question.

Dear @farhan06

Kindly note that as I mentioned the issue already resolved,
Additionally, we will review the mail and get back to you, the main purpose of sharing the details via mail is to do our investigation and schedule one to one meeting if needed.

Thanks for your understanding.
Ibrahem Daoud.

@farhan06

You need to pay attention to the order of the Subject in your CSR. make sure it follows the format as generated by the SDK.

Then the most important thing is in the Template section
Request Extension, you are missing the character “-” in PREZATCA-Code-Signing.

Maybe this is the cause of the Invalid CSR at the time of the PCSID Request.

Hi Fatoora Developer Team,
Now I am getting PCSID Successfully on simulation,
But I am using Arabic while generating CSR so in the simulation portal it is showing like in the given image below .
I am also attaching my cnf file.can you please check it.
And at reporting(invoices/reporting/single) on the last step facing warning X509Certificate (CCSID / PCSID) used for signing is not valid certificate (CCSID / PCSID) for this VAT Registration Number.

(Attachment 01c78533-73be-43b0-aef4-fce639b75d9f.cnf is missing)

@idaoud can you check please

@farhan06 are you using openssl command to generate csr file ? if yes, share the command please

    $result = shell_exec("openssl req -new -sha256 -key $private_key_file_name -config $csr_config_file_name 2>&1");

@farhan06 try to add this before -config (-extensions v3_req -utf8)

1 Like

This will solve this issue ?

@farhan06 Hopefully Inchallah

1 Like

i am still getting this on reporting with pcsid
X509Certificate (CCSID / PCSID) used for signing is not valid certificate (CCSID / PCSID) for this VAT Registration Number

@farhan06
on simulation or sandbox mode ?

1 Like

@bahaeddine on simulation

@bahaeddine but that Arabic issue is solved by using your command suggestion

Dear @farhan06

Kindly check and confirm that you are signing your B2C invoice in the same certificate that you are using in the API authorization.

Thanks,
Ibrahem Daoud.

1 Like

@idaoud yes using same secret and certificate getting from production compliance api (production/csids)