API Upload Picture <Error>
Asked by bastien:

Hello,  
I have a little question about "Upload Picture"  

When i use the command :   
curl -D- -u USER:APIKEY -X POST -H "X-Atlassian-Token: nocheck" -F "file=@image.png" -F "minorEdit=true" -F "comment=Example attachment comment" <https://domaine/rest/api/content/681673960/child/attachment>  

curl: (35) schannel: next InitializeSecurityContext failed: SEC_E_ILLEGAL_MESSAGE (0x80090326) - This error usually occurs when a fatal SSL/TLS alert is received (e.g. handshake failed)  

I follow this :   
[Solved: Uploading attachments using rest api. (atlassian.com)](https://community.atlassian.com/t5/Confluence-questions/Uploading-attachments-using-rest-api/qaq-p/1162753)  
[The Confluence Cloud REST API (atlassian.com)](https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content---attachments/#api-wiki-rest-api-content-id-child-attachment-put)  
[Using the Confluence REST API to upload an attachment to one or more pages \| Confluence \| Atlassian Documentation](https://confluence.atlassian.com/confkb/using-the-confluence-rest-api-to-upload-an-attachment-to-one-or-more-pages-1014274390.html)  

but it didnt work : (


Answers:
author: Humashankar VJ
body: Great problem statement to look in to:

Hi - I hope that you are Doing good !!

Double checkthat you are using the latest version of curl and any relevant libraries on your system

Use the --verbose option with curl to enable verbose output and obtain more detailed information about the SSL/TLS handshake process

With this you able to sort the SEC_E_ILLEGAL_MESSAGE error in your curl command

<br />

Hope this helps

Thank you very much and have a fantastic day!  
Warm regards

comments: author: bastien
body: I got that :

\* Trying 10.150.214.61:443...  
\* Connected to wiki.domaine (ipAdress) port XXX  
\* schannel: disabled automatic use of client certificate  
\* ALPN: curl offers http/1.1  
\* schannel: next InitializeSecurityContext failed: SEC_E_ILLEGAL_MESSAGE (0x80090326) - This error usually occurs when a fatal SSL/TLS alert is received (e.g. handshake failed). More detail may be available in the Windows System event log.  
\* Closing connection  
\* schannel: shutting down SSL/TLS connection with wiki.space.thales port 443  
curl: (35) schannel: next InitializeSecurityContext failed: SEC_E_ILLEGAL_MESSAGE (0x80090326) - This error usually occurs when a fatal SSL/TLS alert is received (e.g. handshake failed). More detail may be available in the Windows System event log.

And i also try : curl --version

curl 8.4.0 (Windows) Schannel WinIDN  
Release-Date: 2023-10-11

|  #  |                   Version                   |    Date     | Since 8.6.0 |          Delta          |||                            Accumulated                             ||||
|  #  |                   Version                   |    Date     | Since 8.6.0 | Days | Bugfixes | Changes | Days | Bugfixes | Changes |                   Vulns                   |
|-----|---------------------------------------------|-------------|-------------|------|----------|---------|------|----------|---------|-------------------------------------------|
| 254 | [8.6.0](https://curl.se/changes.html#8_6_0) | Jan 31 2024 | --          | 56   | 154      | 8       | 56   | 154      | 8       | [0](https://curl.se/docs/vuln-8.6.0.html) |
| 253 | [8.5.0](https://curl.se/changes.html#8_5_0) | Dec 6 2023  | 56 days     | 56   | 183      | 2       | 112  | 337      | 10      | [1](https://curl.se/docs/vuln-8.5.0.html) |
| 252 | [8.4.0](https://curl.se/changes.html#8_4_0) | Oct 11 2023 | 3 months    | 28   | 136      | 3       | 140  | 473      | 13      | [2](https://curl.se/docs/vuln-8.4.0.html) |

I don t know if this version have problem for that...

And i can change version "computer compliance".


Tags: api

cloud

confluence-cloud