-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using openssl to send request to TSA Server failed #6
Comments
Hi there, you also have to set the curl -X POST --data-binary @request.tsq --header "Content-Type: application/timestamp-query" http://localhost:8080/sign -o response.tsr I will nevertheless update the endpoint so the PS: The |
Thanks for your reply on the above issue. Using configuration from /usr/lib/ssl/openssl.cnf TST info: Am I deploying wrong or misunderstanding the problem. I hope you can respond to me soon |
The You can extract the certificate chain by extracting the Timestamp Token first and then extracting the certificate chain: openssl ts -reply -in response.tsr -out response_token.der -token_out
openssl pkcs7 -inform DER -in response_token.der -print_certs -outform PEM -out certificatechain.pem What does the application log say when you use your own |
I saw the certificate after running the 2 commands you gave. When I changed my certificate, it seems that my .p12 file did not satisfy the tsa-server's requirements, so it reported an error. . |
Currently my signing timestamp does not match the real time. How do I adjust it in the docker-compose file? |
Your certificat is missing the To set the correct timezone, you have to set the services:
tsa:
image: "dnl50/tsa-server:3.3.0"
environment:
- TZ=Asia/Bangkok
volumes:
- /path/to/keystore.p12:/work/keystore.p12:ro OpenSSL will still show the timestamp in UTC since it is stored using UTC, but the timestamp should then match your current time when adjusting for your timezone's offset to UTC |
Hi, it's me again openssl ts -reply -in response.tsr -out response_token.der -token_out The certificatechain.pem file returned empty. Do you know what the error is? |
Does your query include the flag to include the certificate details in the response? This has to be requested explicitly by using the
|
Thanks. Accuracy: unspecified |
When I use the command: With: certificate.pem is the rootCA that signed the keystore.p12 I get the following error: Using configuration from /usr/lib/ssl/openssl.cnf |
Sorry for replying so late 😳 OpenSSL prints
I will look into if Bouncy Castle supports setting the field. The verification failure is most likely caused because the TSA certificate is self signed. OpenSSL verifies that the certificate passed to the |
I created the keystore.p12 file with the self-generated cert-key pair and used the following command to sign the cert for tsa-server openssl x509 -req -in tsa-csr.pem -CA myca-02.crt -CAkey myca.key -CAcreateserial -out tsa.crt -days 365 -sha256 -extfile tsa.cnf -extensions v3_ca after having the "tsa.crt" file, I executed the following command to convert the .p12 file openssl pkcs12 -export -inkey tsa-private-key.pem -in tsa.crt -certfile myca-02.crt -out keystore.p12 then, mounted the .p12 file into the container and signed the document. |
Hey there, sorry for replying so late. I documented the commands necessary to issue a valid certificate in the README (see commit 298e6da). With these certificates, I was able to verify the response using OpenSSL:
|
I use command:
openssl dgst -sha256 -binary document.txt > document.hash
openssl ts -query -data document.hash -sha256 -out request.tsq
curl -X POST --data-binary @request.tsq http://localhost:8080 -o response.tsr
But I read the response.tsr file, I get the error message as follows "{"status":500,"message":"The content-type header value did not match the value in @consumes"}"
Help me please...
The text was updated successfully, but these errors were encountered: