Digital Signature TimeStampServer.Timeout is not applied when using PdfLoadedDocument.Save

Hello Syncfusion team,

Hope you are doing great.

I have an issue when using timestampserver ... the server is not stable all the time, sometimes it returns immediately and sometimes it takes a very long time, and Although i am setting the timestampserver with timeout only 10 seconds, the DigitalDocument.Save takes about 2 minutes to respond with timeout error ignoring the timeout i set 

i am using Syncfusion.Pdf.WinForms 27.1.50 .netframework 4.6.2

DigitalSignature.TimeStampServer = New TimeStampServer(New Uri("mytsurl"), Nothing, Nothing, 10)
DigitalSignature.CreateLongTermValidity(certificatechainlist, RevocationType.Crl, True)
DigitalDocument.Save(filename.Replace(".pdf", "_Signed.pdf"))


please check this stack trace with timeout error after around 2 minutes

at System.Net.HttpWebRequest.GetResponse() at Syncfusion.Pdf.Security.TimeStampServer.GetTimeStampResponse(Byte[] request) at Syncfusion.Pdf.Security.PdfCmsSigner.Sign(Byte[] secondDigest, TimeStampServer server, Byte[] timeStampResponse, Byte[] ocsp, ICollection`1 crls, CryptographicStandard sigtype, String hashAlgorithm) at Syncfusion.Pdf.Security.PdfSignatureDictionary.GetPKCS7Content() at Syncfusion.Pdf.Security.PdfSignatureDictionary.DocumentSaved(Object sender, DocumentSavedEventArgs e) at Syncfusion.Pdf.PdfDocumentBase.OnDocumentSaved(DocumentSavedEventArgs args) at Syncfusion.Pdf.Parsing.PdfLoadedDocument.Save(Stream stream) at Syncfusion.Pdf.PdfDocumentBase.Save(String filename)



32 Replies

IJ Irfana Jaffer Sadhik Syncfusion Team February 6, 2025 02:17 PM UTC

Hi Jacobs,

Thank you for reaching out to the Syncfusion team.

To assist you further with the timestamp server timeout issue, could you please provide the following details?

  1. The specific timestamp server URL you are using (or a test server that reproduces the issue).
  2. The steps to replicate the issue, including any specific configurations or certificate details (excluding sensitive information).
  3. Whether the issue occurs with multiple timestamp servers or only with the one specified.
  4. A sample PDF (if possible) or minimal reproducible code to help us analyze the behavior.
  5. Any network-related details, such as firewall restrictions or proxy configurations, that might affect connectivity to the timestamp server.

Once we have this information, we will investigate the issue further and provide a resolution at the earliest.


Regards,

Irfana J



JA Jacobs February 9, 2025 04:51 AM UTC

Hello Irfana,

The issue happens randomly not all the time, on a specific timestamp url which sometimes takes a very along time to respond.

There is no specific pdf it is just an empty pdf for testing.

Again the issue in brief is that the Document.Save function doesnt use the timeout for the timestamp server that i specified in the syncfusion property Timestampserver.timeout which is 10 seconds , and sometimes the timestampserver takes a long time to responds(more than 3 minutes) , i think it has a default timeout for the http request of about 2 minutes or 100 seconds.

I think you can simulate the case on your side if you have a local timestamp server and make it return the timestamp time after 3 or 4 minutes, the document.save will timeout with error after around 2 minutes.

I sent the code and the stack trace that happend with me at the time that the timeout issue occured in my previous reply.

I will be glad if you can check this function source code and its http request to the timestamp server and if it has a specified timeout.

Any call in any syncfusion function to the timestampurl should use the timeout specified in the syncfusion property Timestampserver.timeout .



IJ Irfana Jaffer Sadhik Syncfusion Team February 10, 2025 06:52 AM UTC

Hi Jacobs,


Currently we are analyzing on the reported behavior with the provided details on our end and we will share the further details on February 12th, 2025.


Regards,

Irfana J.



JA Jacobs replied to Irfana Jaffer Sadhik February 12, 2025 12:34 PM UTC

Thanks Irfana, waiting for your reply 🙏



IJ Irfana Jaffer Sadhik Syncfusion Team February 12, 2025 01:48 PM UTC

Hi Jacobs,


We confirmed the issue "Timeout functionality is not working Properly in timestamp server API " as a defect in our product and we will include the fix into our upcoming weekly NuGet release, which will be available on February 25th,2025.

Please use the below feedback link to track the status of the reported bug.


Note: If you require a patch for the reported issue in any of our Essential Studio Main or SP release version, then kindly let us know the version, so that we can provide a patch in that version based on our SLA policy.


Disclaimer: “Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization.”


Regards,

Irfana J.




JA Jacobs replied to Irfana Jaffer Sadhik February 13, 2025 04:19 AM UTC

Thanks alot Irfana and syncfusion team for your usual support.

I appreciate fixing it in Document.Save and Creatlongtermvalidation function (or any function with timestampserver request) and returning error code and error message when catching exception to distinguish that the issue is related to timestamp server request timeout or other error.


It would be great if it is possible to provide a patch for the below version in order to test it before you include it in the next weekly relaease on 25/2/2025

Syncfusion.Pdf.WinForms 27.1.50 dotnetframework 4.6.2



AG Aribalakrishnan Govindasamy Syncfusion Team February 13, 2025 02:07 PM UTC

Hi Jacobs,

Thanks for the update.

Currently, we do not support a timeout function for creating long-term validation (LTV) during signing and signature validation. We have added this feature request to our list. Additionally, we do not have any immediate plans to implement this support. You can track the status of the feature using the following feedback link.

However, we plan to address issues related to the timestamp server and enable LTV using timestamp functionalities. This fix will be included in our upcoming weekly NuGet release, scheduled for 25th Feb 2025.
Regards,
Aribalakrishnan G.


JA Jacobs February 13, 2025 06:15 PM UTC

Ok that's good , i meant also the call to timestampserver url inside the createlongtermvalidation function becasue if i send the parameter includecertificates = true it gets the timestamp certificate chain in order to embed them in dss, so i want to make sure that the fix you will provide will include this also.


It would be great if it is possible to provide a patch for the below version in order to test it before you include it in the next weekly relaease on 25/2/2025 ... Syncfusion.Pdf.WinForms 27.1.50 dotnetframework 4.6.2



AG Aribalakrishnan Govindasamy Syncfusion Team February 14, 2025 05:07 PM UTC


Hi 
Jacobs,
Thanks for the update,
We will provide the patch to the requested version on Feb 20, 2025.
Regards,
Aribalakrishnan G.



JA Jacobs February 20, 2025 08:08 AM UTC

Hello Aribalakrishnan 

i am waiting today for the patch for version Syncfusion.Pdf.WinForms 27.1.50 dotnetframework 4.6.2 windows forms

Also please provide me how will the function behave if timestamp call has timed out, and how will i be able to get the error in catch.



AG Aribalakrishnan Govindasamy Syncfusion Team February 20, 2025 05:12 PM UTC

 Hi Jacobs,

As requested, we have created a custom patch for the mentioned version. Please find the attached custom patch. Let me know if the reported issue has been resolved or not

Regards,

Aribalakrishnan G.


Attachment: CustomPatch_b05f8764.zip


JA Jacobs replied to Aribalakrishnan Govindasamy February 20, 2025 05:32 PM UTC

Thanks ... I will check it

Please provide me how will both functions behave (createlongtermvalidation and Document.Save) if timestamp call has timed out, and how will i be able to get the error in catch ... as the issue happens me randomly when the the timestamp server i am testing with takes a long time to respond and this i can't control.

Waiting for your reply.



AG Aribalakrishnan Govindasamy Syncfusion Team February 21, 2025 04:37 PM UTC

 Hi Jacobs,

As of now, we do not have any functionality to catch errors in the timestamp server. These errors are handled internally during timestamp server validation. You can check whether the timestamp server returns valid API results to determine if there is an error. Please find the API details below,

https://help.syncfusion.com/cr/document-processing/Syncfusion.Pdf.Security.TimeStampServer.html#Syncfusion_Pdf_Security_TimeStampServer_IsValid

Regards,

Aribalakrishnan G







JA Jacobs February 21, 2025 04:43 PM UTC

Iam already using this check before calling the createlongtermvalidation function and the document .save ... however the timeout happens after the checking and returns valid ... but while calling those two functions the timeout may happen ... which should have been fixed in this new version ... my question is will i get a specific error code or message when ts timeout happens ?



AG Aribalakrishnan Govindasamy Syncfusion Team February 24, 2025 04:36 PM UTC

Hi Jacobs,

We do not have support to catch errors while creating a timestamp server. We have provided support to get the error details from signature validation. SignatureValidationErrors Gets the list of signature validation exceptions. Please find the SignatureValidationErrors  API details below,



Regards,
Aribalakrishnan G.




JA Jacobs February 25, 2025 01:22 PM UTC

I am not asking for this ... i meant if an error related with timestamp api call times out when calling the Document.Save or the createlongtermvalidation ... this happens when creating new signature ... while signaturevalidationerrors is not related to creating signature ... it is just when validation so it will not be useful while creating new signature.

What i am asking for that if i set the timeout of timestampserver to 10 seconds in syncfusion object and for some reason the timestamp request that happens internally in library during calling createlongtermvalidation or document.save, the function should fail with exeption indicating timestamp timeout error ... 


also i didnt find the bug fix in the release notes of today's version 28.2.7 (released 25 Feb 2025)

https://help.syncfusion.com/windowsforms/release-notes/v28.2.7?type=all

Image_9632_1740489643149



AG Aribalakrishnan Govindasamy Syncfusion Team February 25, 2025 03:32 PM UTC

Hi Jacob,

We were unable to include the fix for the issue "Timeout functionality is not working properly in timestamp server API" as promised in the weekly release scheduled for today (25/02/2025). This fix will be included in the next weekly release (04/03/2025). Additionally, please confirm whether the custom patch provided has resolved the reported issue.

Regards,

Aribalakrishnan G.





JA Jacobs replied to Aribalakrishnan Govindasamy February 25, 2025 03:42 PM UTC

Stil checking ... but i need an answer to my last reply 



IJ Irfana Jaffer Sadhik Syncfusion Team February 27, 2025 08:48 AM UTC

Hi Jacobs,


Currently, our library does not throw an exception when a timestamp server request times out during CreateLongTermValidation or document.Save. Instead, it caches the error internally and proceeds with signing the document without embedding the timestamp or LTV.

 We understand your requirement to receive an explicit exception indicating a timestamp timeout error. At this time, our library does not provide this functionality. However, we have logged a feature request to enhance error handling for timestamp and LTV server request failures during the signing process.

While we don’t have immediate plans to implement it, we typically review all open feature requests during the planning phase of each release cycle, which occurs approximately every three months. We will consider this feature for future implementation and provide updates once it becomes available.


You can track the status of this feature request from the following feedback link,

Support to Retrieve Error Details for LTV and Time Stamp in PDF Save in WinForms | Feedback Portal



Regards,

Irfana J.





JA Jacobs March 4, 2025 06:43 AM UTC

i checked todays update and still no documented changes for the new version 28.2.9 about the fix 

it should be released today as promised before.


Image_5322_1741070435099


Image_9027_1741070369157



AG Aribalakrishnan Govindasamy Syncfusion Team March 4, 2025 03:21 PM UTC

Hi Jacob,


Sorry for the inconvenience caused.

We are currently dealing with some issues in fixing automation problems. Our team is focused on resolving this quickly. Due to concerns about stability, we cannot include the fix in our last weekly update. We will ensure the solution is included in our next weekly NuGet release, which you can expect on March 11th, 2025.


Regards,

Aribalakrishnan G.



AG Aribalakrishnan Govindasamy Syncfusion Team March 4, 2025 03:21 PM UTC

Hi Jacob,


Sorry for the inconvenience caused.

We are currently dealing with some issues in fixing automation problems. Our team is focused on resolving this quickly. Due to concerns about stability, we cannot include the fix in our last weekly update. We will ensure the solution is included in our next weekly NuGet release, which you can expect on March 11th, 2025.


Regards,

Aribalakrishnan G.



JA Jacobs replied to Aribalakrishnan Govindasamy March 5, 2025 06:43 AM UTC

I will be waiting for the fix (same as custom nuget) next Tuesday,  March 11th.



JA Jacobs replied to Aribalakrishnan Govindasamy March 10, 2025 06:57 AM UTC

Hello Aribalakrishnan,

I am just making sure that the fix included in custom nuget will be included in tomorrow's release 11/03/2025.

Thanks again.



JA Jacobs replied to Aribalakrishnan Govindasamy March 11, 2025 12:46 PM UTC

is it fixed yet ? 



JA Jacobs replied to Irfana Jaffer Sadhik March 12, 2025 06:32 AM UTC

Good morning Irfana,

i am no getting any replies from syncfusion team.



IJ Irfana Jaffer Sadhik Syncfusion Team March 12, 2025 07:38 AM UTC

Hi Jacobs,

We have included the fix for this issue "Timeout functionality is not working properly in timestamp server API" in our latest week release(28.2.11). Please download the NuGet from the below link.

Root Cause:
Timeout functionality is not working Properly in time stamp server API description. We have not set the time out API properly that's why the issue occurred. 


Regards,

Irfana J



JA Jacobs replied to Irfana Jaffer Sadhik March 19, 2025 11:32 AM UTC

Dear Idrana,

Unfortunately the latest release 28.2.11 always returns error The remote name could not be resolved + the tsa url  after  CreateLongTermValidation function, i tested using different timestamp urls and all the same result , however the custom package is working fine.

Waiting for the fix as soon as possible. Thanks



IJ Irfana Jaffer Sadhik Syncfusion Team March 20, 2025 11:16 AM UTC

Hi Jacobs,

Sorry for the inconvenience caused,

Upon further analysis of your report, we have identified an issue related to the timestamp server API timeout. The timeout value for the API is specified in seconds, but internally, we are using HttpWebRequest, where the timeout unit is in milliseconds. The conversion from seconds to milliseconds was missing when setting the HttpWebRequest timeout.
As a temporary workaround, you can set the timestamp server API timeout in milliseconds. Once we resolve this issue and include it in a public release, you can revert to using seconds as usual.
PdfDocument document = new PdfDocument();
PdfPage page = document.Pages.Add();
X509Certificate2 cert = new X509Certificate2(@"D:\Works\Febmonth\Feb20\timeserverpatch\BUG934210.pfx", "syncfusion");
PdfCertificate pdfCert = new PdfCertificate(cert);
PdfSignature signature = new PdfSignature(document, page, null, "syncfusion");
signature.Bounds = new RectangleF(new PointF(0, 0), new SizeF(100, 100));
signature.ContactInfo = "johndoe@owned.us";
signature.LocationInfo = "Honolulu, Hawaii";
signature.Reason = "I am author of this document.";
TimeStampServer timeStampServer = new TimeStampServer(new Uri("https://rfc3161.ai.moda/adobe"), "", "",30000);
signature.TimeStampServer = timeStampServer;
signature.EnableLtv = true;
signature.CreateLongTermValidity(new List<X509Certificate2> { cert });
document.Close(true);


Regards,

Irfana J



JA Jacobs replied to Irfana Jaffer Sadhik March 20, 2025 11:21 AM UTC

ok thanks , i will check this workaround , but i hope you fix this issue in the next release on 25 March 2025.



AG Aribalakrishnan Govindasamy Syncfusion Team March 25, 2025 03:59 PM UTC

Hi Jacobs,

Due to volume 1 main release published code unfreeze. We will include the reported issue in the upcoming weekly release, which is expected on April 2nd, 2025.


Regards,

Aribalakrishnan G

.



JA Jacobs March 25, 2025 06:13 PM UTC

Thanks ... i will be waiting for the fix in next week release ... i am using 10000 as timeout as a temp solution


Loader.
Up arrow icon