1 (edited by Plutus9396 2019-04-23 14:16:57)

Topic: Help Me: Login Restful API returns Error

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 0.9.9
- Deployed with iRedMail Easy or the downloadable installer?
- Linux/BSD distribution name and version: ubuntu 16.04
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx):Nginx
- Manage mail accounts with iRedAdmin-Pro? yes
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Upgrade from iRedMail to iRedAdmin Pro SQL version 3.3, and tried to use curl from my backend code.

curl -X POST -c cookie.txt -d "username=postmaster@cyber.cm.tc&pass=<password>" https://cyber.cm.tc/iredadmin/api/login
but failed to get response

Added ENABLE_RESTFUL_API = True in the setting.py file
The other features are working well such as create email, etc
License correctly activated.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Help Me: Login Restful API returns Error

Dear @Plutu9396,

What do you mean "failed to get response"? What's the output on your console?

3

Re: Help Me: Login Restful API returns Error

When I use windows command prompt it shows

curl: (77) schannel: next InitializeSecurityContext failed: SEC_E_UNTRUSTED_ROOT (0x80090325) - The certificate chain was issued by an authority that is not trusted.


When I use bash shell it shows

curl: (60) SSL certificate problem: self signed certificate
More details here: https://curl.haxx.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.

4

Re: Help Me: Login Restful API returns Error

ok, so you're using a self-signed ssl cert. Please use 'curl -k' to ignore cert verification like this:

curl -k -X POST -c cookie.txt -d "username=postmaster@cyber.cm.tc&pass=<password>" https://cyber.cm.tc/iredadmin/api/login