I am following all the steps for generating Base64 CSR using openssl. I have tried making many changes to the car_config.txt and still get Invalid CSR.
oid_section = OIDs
[OIDs]
certificateTemplateName = 1.3.6.1.4.1.311.20.2
[req]
default_bits = 2048
emailAddress = nkishore@xxxxx.xxx
req_extensions = v3_req
prompt = no
default_md = sha256
distinguished_name = dn
[dn]
C = SA
OU = Riyadh
O = My Organization
CN = PREZATCA-Code-Signing
[v3_req]
basicConstraints = CA:FALSE
keyUsage = digitalSignature, nonRepudiation, keyEncipherment
subjectAltName = dirName:alt_names
certificateTemplateName = ASN1:PRINTABLESTRING:PREZATCA-Code-Signing
[alt_names]
SN = 1-TenderCare|2-Model123|3-ed22f1d8e6a211189b58d9a8f11e445f
UID = 310000000000003
title = 0100
registeredAddress = Riyadh
businessCategory = Healthcare
I have used actual organization name and TRN but I still keep getting Invalid CSR. What am I doing wrong?
Thanks for reaching out, Welcome to our community.
To provide comprehensive support as usual, can I kindly ask you to mention all the steps that you followed from the beginning, Additionally, Providing screenshots will be more helpful for our investigation.
openssl base64 -in taxpayer.csr -out taxpayerCSRbase64Encoded.txt
I then used the base64 encoded text in Swagger on the dev portal and received error: can’t parse json
I posted through Postman, setting all the headers including v2 and the OTP. The error was: Invalid CSR.
Your assistance to resolve this is greatly appreciated.
Thank you and best regards,
Naval
From “Ibrahem Daoud via Fatoora Developer Community” <notifications@zatca1.discoursemail.com>
To “Dr. N. Kishore” <nkishore@tendercare.me>
Date 01/03/2025 2:30:39 PM
Subject [Fatoora Developer Community] [FATOORA portal and Simulation portal] Invalid CSR for simulation
openssl base64 -in taxpayer.csr -out taxpayerCSRbase64Encoded.txt
I then used the base64 encoded text in Swagger on the dev portal and received error: can’t parse json
I posted through Postman, setting all the headers including v2 and the OTP. The error was: Invalid CSR.
Your assistance to resolve this is greatly appreciated.
I had used secp256k1 earlier and have done so again, following the steps given by you.
Do I need to encode the CSR to base64? My results are as below:
Without base64 encoding:
Swagger: can’t parse json
Postman: Invalid CSR: PKCS10csr is invalid or empty
With base64 encoding (openssl base64 -in my.csr -out myCSRbase64Encoded.txt — then remove all line breaks and spaces)
Swagger: can’t parse json
Postman: The provided Certificate Signing Request (CSR) is invalid.
For Swagger I am using the dev portal and for Postman I am using the urls: gw-fatoora.zatca.gov.sa/e-invoicing/core/compliance and gw-fatoora.zatca.gov.sa/e-invoicing/developer-portal/compliance
Thanks for reaching out. I made the changes you suggested: [req] default_bits = 2048 default_md = sha 256 req_extensions = req_ext prompt = no distinguished_name = dn req_extensions = v3_req
Then I generated CSR again, encoded to base64 with openssl base64 -in my.csr -out myCSRbase64Encoded.txt, removed the line-breaks and spaces and am still getting Invalid CSR when I submit.
I really can’t figure out what is wrong. Any help would be gratefully appreciated. Thanks.
From “Baha Eddine via Fatoora Developer Community” <notifications@zatca1.discoursemail.com>
To “Dr. N. Kishore” <nkishore@tendercare.me>
Date 03/03/2025 11:53:43 AM
Subject [Fatoora Developer Community] [FATOORA portal and Simulation portal] Invalid CSR for simulation