AjayRathod1122 | Posts: 2

Got issue on proxy configuration In .NET SDK

0 votes

Hello everyone,

I've shared code details in below :

  ProxyConfiguration httpProxyConfiguration = ProxyConfigurationBuilder.NewProxyConfiguration()
                    .WithHttpHost(_proxyConfiguration.GetHost())
                    .WithHttpPort(_proxyConfiguration.GetHttpPort())
                    .WithCredentials(_proxyConfiguration.GetUserName(), _proxyConfiguration.GetPassword())
                    .Build();
                    Boolean allowAllSSLCertificates = false;

 EslClient eslClient = new EslClient(_apiKey, _apiUrl, allowAllSSLCertificates,                        httpProxyConfiguration);


                    FileStream fs = new FileStream(model.FilePath, FileMode.Open, FileAccess.Read);
                    Signer mysigner = SignerBuilder.NewSignerWithEmail(data.Email)
                                                    .WithFirstName(data.FirstName)
                                                    .WithLastName(data.LastName)
                                                    .WithCustomId("Signer1")
                                                    .Build();
                    DocumentPackage superDuperPackage = PackageBuilder
                   .NewPackageNamed("Test Document")
                   .WithSettings(DocumentPackageSettingsBuilder.NewDocumentPackageSettings())
                   .WithSigner(mysigner)
                   .WithDocument(DocumentBuilder.NewDocumentNamed(model.FileName)
                   .FromStream(fs, DocumentType.PDF)
                   .EnableExtraction())
                   .Build();
                    string applicationVersion = eslClient.SystemService.GetApplicationVersion();
                    PackageId packageId = eslClient.CreatePackage(superDuperPackage);
                    eslClient.SendPackage(packageId);

 

I've got the issue "Could not create a new package. Exception: Object reference not set to an instance of an object." on " string applicationVersion = eslClient.SystemService.GetApplicationVersion();" Or "PackageId packageId = eslClient.CreatePackage(superDuperPackage);".
 

Can you please help to resolve the issue ?

Let me know if any idea about that.

Best Regards
Ajay


Duo_Liang | Posts: 3776

Reply to: Got issue on proxy configuration In .NET SDK

0 votes

Hi Ajay,

 

What's the version of your .Net framework? It might be related to the TLS version, try to add these two lines before the code snippet:


ServicePointManager.SecurityProtocol = (SecurityProtocolType)768; //TLS 1.1

ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072; //TLS 1.2

 

Also have a quick check on this blog.

 

Duo


Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off