# Check if a API's connection is secure

**URL:** <https://community.thunkable.com/t/check-if-a-apis-connection-is-secure/1040758>\
**Category:** Questions about Thunkable X\
**Created:** [December 22, 2020, 10:03am UTC](https://community.thunkable.com/t/check-if-a-apis-connection-is-secure/1040758 "2020-12-22T10:03:01Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![yrimbaud](https://avatars.discourse-cdn.com/v4/letter/y/aeb1de/32.png) [@yrimbaud](https://community.thunkable.com/u/yrimbaud)\
**Post date:** [December 22, 2020, 10:03am UTC](https://community.thunkable.com/t/check-if-a-apis-connection-is-secure/1040758/1 "2020-12-22T10:03:01Z")

</div>

Hi,

I am working on a project where users have to use a form to log in (email + password).

Before using POST to send the data to my API, I was wondering if there is a way for me to check if the link between my app and the API is secure.

Thanks!

---

<div class="post-metadata">

**Author:** ![domhnallohanlon](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/domhnallohanlon/32/29554_2.png) [@domhnallohanlon](https://community.thunkable.com/u/domhnallohanlon)\
**Post date:** [December 22, 2020, 11:08am UTC](https://community.thunkable.com/t/check-if-a-apis-connection-is-secure/1040758/2 "2020-12-22T11:08:08Z")

</div>

Hey @yrimbaud,

What do you mean by “secure” in this context? Are you using https? That’s one layer of security.

If you’re trying to check the integrity of the network you’re connecting on… that’s a different case entirety.

What sort of app are you building?

---

<div class="post-metadata">

**Author:** ![yrimbaud](https://avatars.discourse-cdn.com/v4/letter/y/aeb1de/32.png) [@yrimbaud](https://community.thunkable.com/u/yrimbaud)\
**Post date:** [December 22, 2020, 8:39pm UTC](https://community.thunkable.com/t/check-if-a-apis-connection-is-secure/1040758/3 "2020-12-22T20:39:57Z")

</div>

Thanks for your quick reply.

I am already using HTTPS.

Before sending data to a specific URL, I want to make sure that the connection between the user and the server is secure. If not, I would like to be able to detect it.

---

<div class="post-metadata">

**Author:** ![luv.ak.tech](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/luv.ak.tech/32/104896_2.png) [@luv.ak.tech](https://community.thunkable.com/u/luv.ak.tech)\
**Post date:** [December 23, 2020, 7:08am UTC](https://community.thunkable.com/t/check-if-a-apis-connection-is-secure/1040758/4 "2020-12-23T07:08:45Z")

</div>

hey @yrimbaud the site from where you get api google can see if the site is secure or not go to the website again and see if google is telling it is secure or not

---

<div class="post-metadata">

**Author:** ![yrimbaud](https://avatars.discourse-cdn.com/v4/letter/y/aeb1de/32.png) [@yrimbaud](https://community.thunkable.com/u/yrimbaud)\
**Post date:** [December 23, 2020, 11:15am UTC](https://community.thunkable.com/t/check-if-a-apis-connection-is-secure/1040758/5 "2020-12-23T11:15:33Z")

</div>

That’s an awful solution that you are suggesting! ☹

If I check myself, it might tell me it is safe. However, it does not mean it will be safe for all users. I am trying to prevent man-in-the-middle attacks.

Let me rephrase my initial question: is it possible to check if the SSL handshake was successful?

Thanks.

---

<div class="post-metadata">

**Author:** ![yrimbaud](https://avatars.discourse-cdn.com/v4/letter/y/aeb1de/32.png) [@yrimbaud](https://community.thunkable.com/u/yrimbaud)\
**Post date:** [December 31, 2020, 8:06pm UTC](https://community.thunkable.com/t/check-if-a-apis-connection-is-secure/1040758/6 "2020-12-31T20:06:36Z")

</div>

I found a solution, maybe it might help future readers.

I created an HTML file on my server that contains JavaScript.

`var isSecure = window.isSecureContext`

> **[Window.isSecureContext - Web APIs | MDN](https://developer.mozilla.org/en-US/docs/Web/API/Window/isSecureContext)**

I am using the Web\_Viewer feature that allows us to receive messages from the page. If I receive “true”, then, I know I can continue and start sending/receiving data in secure context.

Et voilà !

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 12:19pm UTC](https://community.thunkable.com/t/check-if-a-apis-connection-is-secure/1040758/7 "2024-11-08T12:19:16Z")

</div>


