Curl commands are failing

curl -u username:password -X MLCOL “

curl: (35) schannel: SNI or certificate check failed: SEC_E_WRONG_PRINCIPAL (0x80090322) - The target principal name is incorrect.

Even I imported the certificate files to Trusted root of my machine where I am executing the above curl command, but still same issue.

try to use -k, e.g. curl -k -u username... this will tell curl to ignore certificate.

Root cause is that Certificate ether Self Signed, or belongs to domain, but your accessing via IP.

ok, but now I am getting this error.

curl -k -u ukreddy:password -X MLCOL “

<?xml version="1.0" encoding="utf-8"?>

<d:error xmlns:d=“DAV:” xmlns:s=“”>
<s:message>There was no plugin in the system that was willing to handle this MLCOL method.</s:message>

Thats it:) You are in nextcloud and it says that it could not work with MLCOL, try to use GET or PUT, e.g. to upload the file:

curl -k --user "$webdavlogin:$webdavpass" -T $LocalDir/$FileName $WEBDAVlink/$Filename

Or install plugin that will give you MLCOL support.

Just find out that it is a part of official docu, but as MKCOL, but not MLCOL:

Try to run:

curl -k -u ukreddy:password -X MKCOL “”

I tried this command

C:\Users\uday>curl -k -u ukreddy:password -T “C:\Users\uday\Downloads\gif.gif” “

<?xml version="1.0" encoding="utf-8"?>

<d:error xmlns:d=“DAV:” xmlns:s=“”>
<s:message>File with name files/ukreddy/t could not be located</s:message>

There is folder “t” in my account root folder “ukreddy” can you suggest why this error comes.

You do not need to specify user in webdav link. It should be in your case as following:

curl -k -u ukreddy:password -T “C:\Users\uday\Downloads\gif.gif” “”