-
Notifications
You must be signed in to change notification settings - Fork 9
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
MaxRequestBodySize and MultipartBodyLengthLimit issues. #7
Comments
It looks like that
Let me know how you go... I haven't tried with such large files :) |
Note that you'll need to add that to the |
Thanks!!! Adding that class did the trick. Afterwards, I was able to sign much larger packages but the allocated RAM was only 2GB. I bumped the RAM up to 8GB and had to increase the timeout in AuthenticodeSigner.cs higher than 10s. I found out that the RAM needed for this server is 4x the size of the largest package you would be signing. If signing a 1.5GB exe, you need at least 6GB of free RAM when the SecureSign service starts. I was expecting it to only need 2x but that was not the case. It DOES seem to hold the memory after signing that package, but subsequent ones of that size seem to process fine. |
C# is garbage collected so it's likely the memory usage would drop a lot when the garbage collector runs. It's possible SecureSign could be optimized a bit more to reduce memory allocations; so far I haven't done any optimizations at all as I'm only using it for small files (few MB). |
Currently the input is stored as a byte array in memory, and data is returned as a byte array. Changing the returned data to a stream should improve things a bit, as then the response could stream from a temp file on the hard drive instead of buffering the entire thing in RAM. I filed #8 to look into that. I'm going on vacation next week and probably won't get a chance to look into it before then though. |
@JoKneeMo Can you please try the latest |
@JoKneeMo - Were you able to try the latest version and see if it works well for you? |
@Daniel15 I realize you have closed this issue, but I wanted to let you know that I encountered this problem again when signing a package larger than 2GB. Nothing I was doing would fix the issue, however, your update did! Thanks! After merging your changes into mine, I was still unable to get it to work immediately. |
I'm having an issue with large files being uploaded but I do not have the C# experience to resolve this issue myself.
Originally, I couldn't sign files larger than 30MB. I would get the following error.
[ERR] An unhandled exception has occurred: Request body too large.
I was able to resolve this by adding the below to line 38 of src/SecureSign.Web/Program.cs
options.Limits.MaxRequestBodySize = null;
However, now I am getting the error
[ERR] An unhandled exception has occurred: Multipart body length limit 134217728 exceeded.
I've tried setting the MultipartBodyLengthLimit as referenced here but is not a valid namespace and I can't seem to figure out what's missing to increase this limit.
For reference, I'm signing a 1.1GB exe package.
The text was updated successfully, but these errors were encountered: