# TLS Error with Interfax via Netlify Functions in Production Only

**URL:** <https://answers.netlify.com/t/tls-error-with-interfax-via-netlify-functions-in-production-only/5044>\
**Category:** Support\
**Tags:** deployment, lambda-functions, environment-vars\
**Created:** [November 12, 2019, 5:42pm UTC](https://answers.netlify.com/t/tls-error-with-interfax-via-netlify-functions-in-production-only/5044 "2019-11-12T17:42:13Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![seanaguinaga](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/seanaguinaga/32/1266_2.png) [@seanaguinaga](https://answers.netlify.com/u/seanaguinaga)\
**Post date:** [November 12, 2019, 5:42pm UTC](https://answers.netlify.com/t/tls-error-with-interfax-via-netlify-functions-in-production-only/5044/1 "2019-11-12T17:42:13Z")

</div>

Faxes send perfectly in development mode using netlify-lambda.

I get a TLS error in production only.

> Delivery Error { Error: socket hang up  
> at TLSSocket.onHangUp (\_tls\_wrap.js:1137:19)  
> at Object.onceWrapper (events.js:313:30)  
> at emitNone (events.js:111:20)  
> at TLSSocket.emit (events.js:208:7)  
> at endReadableNT (\_stream\_readable.js:1064:12)  
> at \_combinedTickCallback (internal/process/next\_tick.js:138:11)  
> at process.\_tickDomainCallback (internal/process/next\_tick.js:218:9)  
> code: ‘ECONNRESET’,  
> path: null,  
> host: ‘[rest.interfax.net](http://rest.interfax.net)’,  
> port: 443,  
> localAddress: undefined }

I got this message from an interfax employee regarding the issue:

> Hello Sean,
> 
> Based upon the error, it seems to be related to the TLS and the possibly the cipher’s attempting to be used by your application. For a list of cipher’s our endpoint supports, please reference the image below and/or the following link: [SSL Server Test: rest.interfax.net (Powered by Qualys SSL Labs)](https://www.ssllabs.com/ssltest/analyze.html?d=rest.interfax.net&latest)
> 
> ​
> 
> Thank you,
> 
> **Anthony Cox**  
> **Technical Support Engineer, Client Services**

- your netlify istance name, for example: `app-typescript.netlify.com`

---

<div class="post-metadata">

**Author:** ![futuregerald](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/futuregerald/32/33_2.png) [@futuregerald](https://answers.netlify.com/u/futuregerald)\
**Post date:** [November 13, 2019, 10:56pm UTC](https://answers.netlify.com/t/tls-error-with-interfax-via-netlify-functions-in-production-only/5044/2 "2019-11-13T22:56:30Z")

</div>

Hi @seanaguinaga , which version of node are you using locally? Can you try with node 10 and see if you have the same trouble? You can find more information on changing the node version for your function in [Build functions | Netlify Docs](https://docs.netlify.com/functions/build-with-javascript/#runtime-settings)

---

<div class="post-metadata">

**Author:** ![seanaguinaga](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/seanaguinaga/32/1266_2.png) [@seanaguinaga](https://answers.netlify.com/u/seanaguinaga)\
**Post date:** [November 14, 2019, 1:45am UTC](https://answers.netlify.com/t/tls-error-with-interfax-via-netlify-functions-in-production-only/5044/3 "2019-11-14T01:45:46Z")

</div>

I am running Node 12.13.0.

I switched to Node 10 and it still worked locally.

I changed NODE\_VERSION to 12 in Netlify and it still fails with the same error.

---

<div class="post-metadata">

**Author:** ![futuregerald](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/futuregerald/32/33_2.png) [@futuregerald](https://answers.netlify.com/u/futuregerald)\
**Post date:** [November 14, 2019, 10:16pm UTC](https://answers.netlify.com/t/tls-error-with-interfax-via-netlify-functions-in-production-only/5044/4 "2019-11-14T22:16:50Z")

</div>

What’s the library that you’re using? Can you share your repo or is it private? @seanaguinaga

---

<div class="post-metadata">

**Author:** ![seanaguinaga](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/seanaguinaga/32/1266_2.png) [@seanaguinaga](https://answers.netlify.com/u/seanaguinaga)\
**Post date:** [November 14, 2019, 10:41pm UTC](https://answers.netlify.com/t/tls-error-with-interfax-via-netlify-functions-in-production-only/5044/5 "2019-11-14T22:41:16Z")

</div>

**My Repo:**

[https://github.com/preconceptioncode/app-ts](https://github.com/preconceptioncode/app-ts)

**Library:**

> **[GitHub - interfax/interfax-nodejs: Fax send and receive in Node.js /...](https://github.com/interfax/interfax-nodejs)**
>
> Fax send and receive in Node.js / Javascript with the InterFAX REST API - GitHub - interfax/interfax-nodejs: Fax send and receive in Node.js / Javascript with the InterFAX REST API

function endpoint to hit:

XYZ … /.netlify/functions/lab-result-send-fax

---

<div class="post-metadata">

**Author:** ![fool](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/fool/32/37_2.png) [@fool](https://answers.netlify.com/u/fool)\
**Post date:** [November 18, 2019, 6:48pm UTC](https://answers.netlify.com/t/tls-error-with-interfax-via-netlify-functions-in-production-only/5044/6 "2019-11-18T18:48:55Z")

</div>

Our staff cannot see into your repo (only our build network can), just for future reference, Sean.

The only run of that function which I can see (by path) in the last week was on your “app” site, and returned a 200 OK which I guess means that things worked?

I don’t see any other initiations on our CDN in the past 30 days at that path, so maybe we never even called the function, or you have it running under a different name, or something?

---

<div class="post-metadata">

**Author:** ![seanaguinaga](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/seanaguinaga/32/1266_2.png) [@seanaguinaga](https://answers.netlify.com/u/seanaguinaga)\
**Post date:** [November 19, 2019, 12:00am UTC](https://answers.netlify.com/t/tls-error-with-interfax-via-netlify-functions-in-production-only/5044/7 "2019-11-19T00:00:36Z")

</div>

> [https://github.com/preconceptioncode/app-ts](https://github.com/preconceptioncode/app-ts)
> 
> Should be public
> 
> after signing in to
> 
> ([https://app.preconceptiontest.com/](https://app.preconceptiontest.com/))
> 
> with
> 
> email/username:
> 
> [netlify@test.com](mailto:netlify@test.com)
> 
> password:
> 
> 12345678
> 
> Hit the endpoint multiple times:
> 
> /.netlify/functions/lab-result-send-fax
> 
> It will eventually give you the TLSSocket Delivery error.
> 
> Please ignore my sloppy http status codes! lol
> 
> > 3:49:37 PM: lab-result-send-fax invoked
> > 
> > 3:49:37 PM: 2019-11-18T23:47:08.302Z c278d190-2e56-4124-81e0-525f24955e36 Created File File {  
> > \_documents:  
> > Documents {  
> > \_client:  
> > Client {  
> > \_https: [Object],  
> > \_credentials: [Object],  
> > \_version: ‘0.8.1’,  
> > \_debug: false } },  
> > ready: true,  
> > \_callbacks: ,  
> > \_chunkSize: 1048576,  
> > header: ‘Content-Type: application/pdf’,  
> > body: \<Buffer 25 50 44 46 2d 31 2e 34 0a 31 20 30 20 6f 62 6a 0a 3c 3c 0a 2f 54 69 74 6c 65 20 28 fe ff 29 0a 2f 43 72 65 61 74 6f 72 20 28 fe ff 00 77 00 6b 00 68 … \> }
> > 
> > 3:49:37 PM: Delivery Error { Error: socket hang up  
> > at TLSSocket.onHangUp (\_tls\_wrap.js:1137:19)  
> > at Object.onceWrapper (events.js:313:30)  
> > at emitNone (events.js:111:20)  
> > at TLSSocket.emit (events.js:208:7)  
> > at endReadableNT (\_stream\_readable.js:1064:12)  
> > at \_combinedTickCallback (internal/process/next\_tick.js:138:11)  
> > at process.\_tickDomainCallback (internal/process/next\_tick.js:218:9)  
> > code: ‘ECONNRESET’,  
> > path: null,  
> > host: ‘[rest.interfax.net](http://rest.interfax.net/)’,  
> > port: 443,  
> > localAddress: undefined }
> > 
> > 3:49:37 PM: Delivery Error { Error: socket hang up  
> > at TLSSocket.onHangUp (\_tls\_wrap.js:1137:19)  
> > at Object.onceWrapper (events.js:313:30)  
> > at emitNone (events.js:111:20)  
> > at TLSSocket.emit (events.js:208:7)  
> > at endReadableNT (\_stream\_readable.js:1064:12)  
> > at \_combinedTickCallback (internal/process/next\_tick.js:138:11)  
> > at process.\_tickDomainCallback (internal/process/next\_tick.js:218:9)  
> > code: ‘ECONNRESET’,  
> > path: null,  
> > host: ‘[rest.interfax.net](http://rest.interfax.net/)’,  
> > port: 443,  
> > localAddress: undefined }
> > 
> > 3:49:37 PM: Buffer \<Buffer 25 50 44 46 2d 31 2e 34 0a 31 20 30 20 6f 62 6a 0a 3c 3c 0a 2f 54 69 74 6c 65 20 28 fe ff 29 0a 2f 43 72 65 61 74 6f 72 20 28 fe ff 00 77 00 6b 00 68 … \>
> > 
> > 3:49:37 PM: Data undefined
> 
> Like I said before, this works fine locally and used to work fine in production! Alas, not anymore.
> 
> From Interfax:
> 
> **Anthony Cox** (Upland Success)
> 
> Nov 12, 17:27 UTC
> 
> Hello Sean,
> 
> Based upon the error, it seems to be related to the TLS and the possibly the cipher’s attempting to be used by your application. For a list of cipher’s our endpoint supports, please reference the image below and/or the following link: [SSL Server Test: rest.interfax.net (Powered by Qualys SSL Labs)](https://www.ssllabs.com/ssltest/analyze.html?d=rest.interfax.net&latest)
> 
> Thank you,
> 
> **Anthony Cox**  
> **Technical Support Engineer, Client Services**
> 
> [interfaxus-support@uplandsoftware.com]
> 
> and image:
> 
> ![inline-962237337.png543x334](https://mail.google.com/mail/u/0?ui=2&ik=7da365fdb6&attid=0.1&permmsgid=msg-a:r-6530987172748383534&th=16e80f1c3f9b2867&view=fimg&sz=s0-l75-ft&attbid=ANGjdJ8M2A9DujrVe2O6vhivXCrThsZoKKHvOCGy86gEjmznPcAa4ixiRqA-fY5YbLWrH9V7SSa1UBpakK1UgHdV1QuNOENgdVwwOtyTDID9pQRcu_idjhqFEqjd77Q&disp=emb&realattid=ii_k3537mvy0)

---

<div class="post-metadata">

**Author:** ![seanaguinaga](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/seanaguinaga/32/1266_2.png) [@seanaguinaga](https://answers.netlify.com/u/seanaguinaga)\
**Post date:** [November 19, 2019, 2:08pm UTC](https://answers.netlify.com/t/tls-error-with-interfax-via-netlify-functions-in-production-only/5044/9 "2019-11-19T14:08:41Z")

</div>

Checked those logs and it looks like it worked for you guys!

Did you do anything or did it just work for you!?

---

<div class="post-metadata">

**Author:** ![Dennis](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/dennis/32/34_2.png) [@Dennis](https://answers.netlify.com/u/Dennis)\
**Post date:** [November 21, 2019, 11:20am UTC](https://answers.netlify.com/t/tls-error-with-interfax-via-netlify-functions-in-production-only/5044/10 "2019-11-21T11:20:42Z")

</div>

We didn’t do anything differently. Just triggered the function from our end.

One thing to try would be setting your function to use Node12 by [setting a runtime variable](https://docs.netlify.com/functions/build-with-javascript/#runtime-settings), specifically the AWS\_LAMBDA\_JS\_RUNTIME variable should be set to `nodejs12.x`. Note that this variable is different from NODE\_VERSION which sets the Node version for the buildbot only.
