# Libcurl debug off

**URL:** <https://clarionhub.com/t/libcurl-debug-off/8169>\
**Category:** questions\
**Tags:** libcurl\
**Created:** [May 16, 2025, 5:57am UTC](https://clarionhub.com/t/libcurl-debug-off/8169 "2025-05-16T05:57:01Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Diamantidis](https://clarionhub.com/user_avatar/clarionhub.com/michael_diamantidis/32/430_2.png) [@Michael\_Diamantidis](https://clarionhub.com/u/Michael_Diamantidis)\
**Post date:** [May 16, 2025, 5:57am UTC](https://clarionhub.com/t/libcurl-debug-off/8169/1 "2025-05-16T05:57:01Z")

</div>

Hello! I want to remove Debug info for libculr when an app run with libcurl and I can't find how?  
Because In DebugView++ I see many debug info from libcurl.  
Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Mike\_Duglas](https://clarionhub.com/user_avatar/clarionhub.com/mike_duglas/32/1061_2.png) [@Mike\_Duglas](https://clarionhub.com/u/Mike_Duglas)\
**Post date:** [May 16, 2025, 11:41am UTC](https://clarionhub.com/t/libcurl-debug-off/8169/2 "2025-05-16T11:41:07Z")

</div>

Use SetDebugInfoFilter method.

---

<div class="post-metadata">

**Author:** ![Michael\_Diamantidis](https://clarionhub.com/user_avatar/clarionhub.com/michael_diamantidis/32/430_2.png) [@Michael\_Diamantidis](https://clarionhub.com/u/Michael_Diamantidis)\
**Post date:** [May 16, 2025, 4:11pm UTC](https://clarionhub.com/t/libcurl-debug-off/8169/3 "2025-05-16T16:11:03Z")

</div>

Thank you Mike. But I need an example please! Is this a curl method? Because I can’t find it.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Mike\_Duglas](https://clarionhub.com/user_avatar/clarionhub.com/mike_duglas/32/1061_2.png) [@Mike\_Duglas](https://clarionhub.com/u/Mike_Duglas)\
**Post date:** [May 16, 2025, 5:22pm UTC](https://clarionhub.com/t/libcurl-debug-off/8169/4 "2025-05-16T17:22:46Z")

</div>

If you can’t find it, try to upgrade.

---

<div class="post-metadata">

**Author:** ![Michael\_Diamantidis](https://clarionhub.com/user_avatar/clarionhub.com/michael_diamantidis/32/430_2.png) [@Michael\_Diamantidis](https://clarionhub.com/u/Michael_Diamantidis)\
**Post date:** [May 22, 2025, 4:59pm UTC](https://clarionhub.com/t/libcurl-debug-off/8169/5 "2025-05-22T16:59:11Z")

</div>

I update to last version but I use TCurlHttpClass and not TCurlClass.  
The SetDebugInfoFilter is only in TCurlClass.  
Thank you!

---

<div class="post-metadata">

**Author:** ![Mike\_Duglas](https://clarionhub.com/user_avatar/clarionhub.com/mike_duglas/32/1061_2.png) [@Mike\_Duglas](https://clarionhub.com/u/Mike_Duglas)\
**Post date:** [May 22, 2025, 6:12pm UTC](https://clarionhub.com/t/libcurl-debug-off/8169/6 "2025-05-22T18:12:34Z")

</div>

Read “CLASS (object declaration)” topic in the Clarion help.

---

<div class="post-metadata">

**Author:** ![Michael\_Diamantidis](https://clarionhub.com/user_avatar/clarionhub.com/michael_diamantidis/32/430_2.png) [@Michael\_Diamantidis](https://clarionhub.com/u/Michael_Diamantidis)\
**Post date:** [May 23, 2025, 6:26am UTC](https://clarionhub.com/t/libcurl-debug-off/8169/7 "2025-05-23T06:26:48Z")

</div>

```clarion
GetImage PROCEDURE(STRING pURL, *STRING pErrorMsg)
curl TCurlHttpClass
res CURLcode
tempFileName STRING(255)
CODE
	pErrorMsg = ''
	tempFileName = CLIP(COM:S1URL4)
	curl.Init()
	IF UPPER(SUB(CLIP(pURL),1,5)) = 'HTTPS'
		res = curl.SetSSLVerifyHost(FALSE)
		IF res <> CURLE_OK
			pErrorMsg = 'SetSSLVerifyHost Error: ' & curl.StrError(res)
			RETURN
		END
		res = curl.SetSSLVerifyPeer(FALSE)
		IF res <> CURLE_OK
			pErrorMsg = 'SetSSLVerifyPeer Error: ' & curl.StrError(res)
			RETURN
		END
		res = curl.SetSSLVersion(CURL_SSLVERSION_DEFAULT)
		IF res <> CURLE_OK
			pErrorMsg = 'SetSSLVersion Error: ' & curl.StrError(res)
			RETURN
		END
	END
	res = curl.ReadFile(pURL, tempFileName)
	IF res = CURLE_OK
	ELSIF res = -1
		pErrorMsg = 'Cannot create local file: ' & tempFileName
	ELSE
		pErrorMsg = 'Download failed: ' & curl.StrError(res)
	END
	curl.Cleanup()
	RETURN

```

---

<div class="post-metadata">

**Author:** ![Mike\_Duglas](https://clarionhub.com/user_avatar/clarionhub.com/mike_duglas/32/1061_2.png) [@Mike\_Duglas](https://clarionhub.com/u/Mike_Duglas)\
**Post date:** [May 23, 2025, 1:47pm UTC](https://clarionhub.com/t/libcurl-debug-off/8169/8 "2025-05-23T13:47:55Z")

</div>

> [@Michael\_Diamantidis](#):
>
> res = curl.SetSSLVerifyHost(FALSE)

Doesn’t this throw a compilation error, because the SetSSLVerifyHost method isn’t in TCurlHttpClass?

---

<div class="post-metadata">

**Author:** ![Michael\_Diamantidis](https://clarionhub.com/user_avatar/clarionhub.com/michael_diamantidis/32/430_2.png) [@Michael\_Diamantidis](https://clarionhub.com/u/Michael_Diamantidis)\
**Post date:** [May 23, 2025, 4:00pm UTC](https://clarionhub.com/t/libcurl-debug-off/8169/9 "2025-05-23T16:00:36Z")

</div>

The version that I use now and compiled is:

```clarion
GetImage PROCEDURE(STRING pURL, *STRING pErrorMsg)
curl TCurlHttpClass
res CURLcode
tempFileName STRING(255)
CODE
	pErrorMsg = ''
	tempFileName = CLIP(COM:S1URL4)
	curl.Init()
	res = curl.SetOpt(CURLOPT_VERBOSE, FALSE)
	res = curl.SetOpt(CURLOPT_DEBUGFUNCTION, 0)
	IF UPPER(SUB(CLIP(pURL),1,5)) = 'HTTPS'
		res = curl.SetSSLVerifyHost(FALSE)
		IF res <> CURLE_OK
			pErrorMsg = 'SetSSLVerifyHost Error: ' & curl.StrError(res)
			RETURN
		END
		res = curl.SetSSLVerifyPeer(FALSE)
		IF res <> CURLE_OK
			pErrorMsg = 'SetSSLVerifyPeer Error: ' & curl.StrError(res)
			RETURN
		END
		res = curl.SetSSLVersion(CURL_SSLVERSION_DEFAULT)
		IF res <> CURLE_OK
			pErrorMsg = 'SetSSLVersion Error: ' & curl.StrError(res)
			RETURN
		END
	END
	res = curl.ReadFile(pURL, tempFileName)
	IF res = CURLE_OK
	ELSIF res = -1
		pErrorMsg = 'Cannot create local file: ' & tempFileName
	ELSE
		pErrorMsg = 'Download failed: ' & curl.StrError(res)
	END
	curl.Cleanup()
	RETURN

```

---

<div class="post-metadata">

**Author:** ![Mike\_Duglas](https://clarionhub.com/user_avatar/clarionhub.com/mike_duglas/32/1061_2.png) [@Mike\_Duglas](https://clarionhub.com/u/Mike_Duglas)\
**Post date:** [May 23, 2025, 4:42pm UTC](https://clarionhub.com/t/libcurl-debug-off/8169/10 "2025-05-23T16:42:38Z")

</div>

Yup, so much effort just to avoid reading the help 🙂

---

<div class="post-metadata">

**Author:** ![Michael\_Diamantidis](https://clarionhub.com/user_avatar/clarionhub.com/michael_diamantidis/32/430_2.png) [@Michael\_Diamantidis](https://clarionhub.com/u/Michael_Diamantidis)\
**Post date:** [May 23, 2025, 5:43pm UTC](https://clarionhub.com/t/libcurl-debug-off/8169/11 "2025-05-23T17:43:10Z")

</div>

I don’t understand what you mean. I read the help but I can’t find how to make debug off.

---

<div class="post-metadata">

**Author:** ![urayoan](https://clarionhub.com/user_avatar/clarionhub.com/urayoan/32/1288_2.png) [@urayoan](https://clarionhub.com/u/urayoan)\
**Post date:** [May 23, 2025, 6:27pm UTC](https://clarionhub.com/t/libcurl-debug-off/8169/12 "2025-05-23T18:27:26Z")

</div>

@Michael_Diamantidis , maybe this help (CLASSes are not my strong part in Clarion)

First declare the class you want to use

```clarion
curlLog CLASS(TCurlClass)
END!Class

```

Then (i guess at the init of the procedure) set this

```clarion
curlLog.SetDebugInfoFilter(CURL_DEBUGINFO_NONE)

CURL_DEBUGINFO_NONE is an equate defined in libcurl.inc, there are other options as well. The default is CURL_DEBUGINFO_ALL

!- Debug info bits
CURL_DEBUGINFO_TEXT EQUATE(00000001b) !- informational text
CURL_DEBUGINFO_HEADER_IN EQUATE(00000010b) !- header (or header-like) data received from the peer
CURL_DEBUGINFO_HEADER_OUT EQUATE(00000100b) !- header (or header-like) data sent to the peer
CURL_DEBUGINFO_DATA_IN EQUATE(00001000b) !- unprocessed protocol data received from the peer
CURL_DEBUGINFO_DATA_OUT EQUATE(00010000b) !- protocol data sent to the peer
CURL_DEBUGINFO_SSL_DATA_IN EQUATE(00100000b) !- SSL/TLS (binary) data received from the peer
CURL_DEBUGINFO_SSL_DATA_OUT EQUATE(01000000b) !- SSL/TLS (binary) data sent to the peer
CURL_DEBUGINFO_IN EQUATE(00101011b) !- incoming on;ly
CURL_DEBUGINFO_OUT EQUATE(01010101b) !- outgoing only
!bitmasks
CURL_DEBUGINFO_NONE EQUATE(00000000b) !- off
CURL_DEBUGINFO_NO_DATA_IN EQUATE(11010111b) !- don't log CURL_DEBUGINFO_DATA_IN and CURL_DEBUGINFO_SSL_DATA_IN
CURL_DEBUGINFO_NO_DATA_OUT EQUATE(10101111b) !- don't log CURL_DEBUGINFO_DATA_OUT and CURL_DEBUGINFO_SSL_DATA_OUT
CURL_DEBUGINFO_NO_DATA EQUATE(00000111b) !- don't log any DATA
CURL_DEBUGINFO_ALL EQUATE(11111111b) !- no filters

```

---

<div class="post-metadata">

**Author:** ![Mike\_Duglas](https://clarionhub.com/user_avatar/clarionhub.com/mike_duglas/32/1061_2.png) [@Mike\_Duglas](https://clarionhub.com/u/Mike_Duglas)\
**Post date:** [May 23, 2025, 6:31pm UTC](https://clarionhub.com/t/libcurl-debug-off/8169/13 "2025-05-23T18:31:50Z")

</div>

Once again, to filter or completely turn the debug logging off I suggested

> Use SetDebugInfoFilter method.

but it doesn’t work for you for some reason, no problem.

---

<div class="post-metadata">

**Author:** ![urayoan](https://clarionhub.com/user_avatar/clarionhub.com/urayoan/32/1288_2.png) [@urayoan](https://clarionhub.com/u/urayoan)\
**Post date:** [May 23, 2025, 6:49pm UTC](https://clarionhub.com/t/libcurl-debug-off/8169/14 "2025-05-23T18:49:14Z")

</div>

Ha! I figure it out

Check the example DownloadFile.clw @Michael_Diamantidis that is included in the libcurl template.

> <https://github.com/mikeduglas/libcurl/blob/master/examples/DownloadFile/DownloadFile.clw>

Hope this helps

---

<div class="post-metadata">

**Author:** ![Michael\_Diamantidis](https://clarionhub.com/user_avatar/clarionhub.com/michael_diamantidis/32/430_2.png) [@Michael\_Diamantidis](https://clarionhub.com/u/Michael_Diamantidis)\
**Post date:** [May 23, 2025, 7:53pm UTC](https://clarionhub.com/t/libcurl-debug-off/8169/15 "2025-05-23T19:53:26Z")

</div>

Thank you for your help!
