# Curl usage

**URL:** <https://community.f5.com/t/curl-usage/74708>\
**Category:** Technical Forums\
**Tags:** application-delivery\
**Created:** [June 24, 2024, 2:19pm UTC](https://community.f5.com/t/curl-usage/74708 "2024-06-24T14:19:05Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![eagertolearn](https://avatars.discourse-cdn.com/v4/letter/e/d6d6ee/32.png) [@eagertolearn](https://community.f5.com/u/eagertolearn)\
**Post date:** [June 24, 2024, 2:19pm UTC](https://community.f5.com/t/curl-usage/74708/1 "2024-06-24T14:19:05Z")

</div>

Hi Experts,

We want to check the status of pool members Eg. service status locally on server, wanted to ensure that user is not offloading any SSL certificate on server locally, Ciphers on servers etc through F5 CLI.

Can anyone share the exact CURL command to&nbsp; check&nbsp; , In addition to this…as per our knowledge curl command should work only in BASH mode and not in tmsh.

Would be great if suggestion can be made in response for which curl output to be check against each service status.

---

<div class="post-metadata">

**Author:** ![svs](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/svs/32/4755_2.png) [@svs](https://community.f5.com/u/svs)\
**Post date:** [June 24, 2024, 3:23pm UTC](https://community.f5.com/t/curl-usage/74708/2 "2024-06-24T15:23:08Z")

</div>

A simple curl command to check, whether your HTTP service works as you want would be

```bash
curl -vk https://<IP of your server>[:<Port of your Service>]<URI of your Service>

```

A full example could be

```bash
curl -vk https://192.168.10.15/path/to/my/app

```

This would result in an HTTP request

```http
GET /path/to/my/app HTTP/1.1 Host: 192.168.10.15 Connection: keep-alive ...

```

If your server uses name-based Virtual Hosts, you have to adjust the Host-header field, to get the correct response:

```bash
curl -vk https//192.168.10.15/path/to/my/app -H "Host: myapp.example.com"

```

You can set more custom headers with `-H`, if necessary.

curl can only be used within the advanced shell (=Bash). A good practice to check for the health status of your app depends on you. A simple HTTP monitor, which checks the response code of your app is better than a simple tcp check, i.e.

```auto
HTTP/1.(0|1) (200|404|403)

```

would check for a HTTP/1.0 or HTTP/1.1 response, accepting response codes 200, 404 and 403 - for whatever reason this may make sense…

A better approach is a built-in health check in your applications, where the application owner has created an health endpoint, which is callable via HTTP, i.e.

```bash
curl -vk https//192.168.10.15/status/health

```

returns

```http
HTTP/1.1 200 OK ... Content-Type: application/json {"status": "ok"}

```

These are just some ideas, based on you questions. From my experience such advanced monitors are rare. In the cases I know of, they are mostly simple monitors that only check for response status code 200.

---

<div class="post-metadata">

**Author:** ![zamroni777](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/zamroni777/32/1473_2.png) [@zamroni777](https://community.f5.com/u/zamroni777)\
**Post date:** [June 24, 2024, 5:09pm UTC](https://community.f5.com/t/curl-usage/74708/3 "2024-06-24T17:09:40Z")

</div>

```auto
curl -vk https://..............

```

it will show deatils of the tls session setup

---

<div class="post-metadata">

**Author:** ![eagertolearn](https://avatars.discourse-cdn.com/v4/letter/e/d6d6ee/32.png) [@eagertolearn](https://community.f5.com/u/eagertolearn)\
**Post date:** [June 24, 2024, 5:35pm UTC](https://community.f5.com/t/curl-usage/74708/4 "2024-06-24T17:35:15Z")

</div>

Hi,

Thanks for quick response.

But, if we use “k” (-vk) then this means ignore to check the SSL Certificate status on pool member.

if we want to check whether application team is offloading any ssl certificate on backend server or not OR if they are offloading then is certificate valid or expired , how to ensure this using curl command.

---

<div class="post-metadata">

**Author:** ![boneyard](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/boneyard/32/20419_2.png) [@boneyard](https://community.f5.com/u/boneyard)\
**Post date:** [June 24, 2024, 5:59pm UTC](https://community.f5.com/t/curl-usage/74708/5 "2024-06-24T17:59:33Z")

</div>

don’t get the offloading part. do you mean if they have a certificate or not?

if they don’t and you do a curl -vk [https://ip](https://ip) it will fail.

if they do and you do a curl -vk [https://ip](https://ip) it will contain the certificate date.

---

<div class="post-metadata">

**Author:** ![eagertolearn](https://avatars.discourse-cdn.com/v4/letter/e/d6d6ee/32.png) [@eagertolearn](https://community.f5.com/u/eagertolearn)\
**Post date:** [June 24, 2024, 6:20pm UTC](https://community.f5.com/t/curl-usage/74708/6 "2024-06-24T18:20:45Z")

</div>

Thanks for reply boneyard !

One more information, If pool member is not on https (443) then . For Example , pool member is on port 5442&nbsp; and&nbsp; now we just wanted to check the port service status during troubleshooting.

What should be the curl command coordinates for this case

---

<div class="post-metadata">

**Author:** ![Mohamed\_Ahmed\_Kansoh](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/mohamed_ahmed_kansoh/32/10886_2.png) [@Mohamed\_Ahmed\_Kansoh](https://community.f5.com/u/Mohamed_Ahmed_Kansoh)\
**Post date:** [June 26, 2024, 4:46pm UTC](https://community.f5.com/t/curl-usage/74708/7 "2024-06-26T16:46:25Z")

</div>

Hi,&nbsp;  
I am adding a very important usage for curl command.

```textile
curl -Ik https://<Virtual_server_Ip>/path1/path2/........

```

This command shows you accessing Virtual server throughout Bigip itself , this very very useful when you need to test the virtual server from internal network and isolate the external one , also if there are an issue or something drops packets on your Bigip like ( AWAF , APM … ) this will confirm that something configured wrong in bigip or Virtual server Configuration and it needs to be reviewed and modified.

Also you can see logs from this curl test:&nbsp;  
When doing this Curl command, Bigip will use its external self IP address as a source IP and the destination is the Virtual server.

Take this note beside @svs & @boneyard@zamroni777@eagertolearn

thanks

---

<div class="post-metadata">

**Author:** ![svs](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/svs/32/4755_2.png) [@svs](https://community.f5.com/u/svs)\
**Post date:** [June 26, 2024, 11:05pm UTC](https://community.f5.com/t/curl-usage/74708/8 "2024-06-26T23:05:25Z")

</div>

That’s a really good point. I personally prefer Postman for tests “from the outside”, if possible.

I would like to emphasize the flag **-I** that you mentioned. Especially when it comes to test health monitors I usually use the HEAD-Method, instead of GET, if I only check the response code. This reduces the amount of unnecessary data between the BIG-IP and server drastically.

---

<div class="post-metadata">

**Author:** ![svs](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/svs/32/4755_2.png) [@svs](https://community.f5.com/u/svs)\
**Post date:** [June 26, 2024, 11:15pm UTC](https://community.f5.com/t/curl-usage/74708/9 "2024-06-26T23:15:58Z")

</div>

Maybe you should play around a bit with the information you got. I would assume, that it is self-explanatory…

```bash
curl -vkI https://192.168.10.15:5442/status/health

```

Just add the port to the IP address or hostname. If you call the server via https:// but the server only speaks http:// (and vice versa), you usally receive&nbsp;_400 Bad request_ as response. That’s not always the case. But you should always receive a certificate, when calling via https://. Otherwise curl will complain, that no certificate was received.

You are wrong about the argument regarding **-k**. This option just helps you to establish an SSL handshake, even if the server certificate is not trustworthy. You will receive the required information in each case. If you have to validate the trustworthiness of the remote certificate, you please checkout [https://curl.se/docs/sslcerts.html](https://curl.se/docs/sslcerts.html). This should help to understand how it works. They also reference the _openssl s\_client_ tool, which helps for deeper investigations. curl is not made for this.
