Raised This Month: $231 Target: $400
 57% 

[EXTENSION] System2 - Easy to use HTTP(S)/FTP Request API and useful system natives


Post New Thread Reply   
 
Thread Tools Display Modes
dordnung
Veteran Member
Join Date: Apr 2010
Old 05-04-2020 , 20:50   Re: [EXTENSION] System2 - Easy to use HTTP(S)/FTP Request API and useful system nativ
Reply With Quote #111

It uses always passive method, so i think there is another issue
__________________
dordnung is offline
TandelK
Member
Join Date: Jun 2015
Location: Surat, India
Old 05-23-2020 , 04:41   Re: [EXTENSION] System2 - Easy to use HTTP(S)/FTP Request API and useful system nativ
Reply With Quote #112

Quote:
Originally Posted by dordnung View Post
It uses always passive method, so i think there is another issue
@dornung

Sorry i meant to ask if it support TTL/SSL Explicit encryption because i have a web hosting whose FTP Server only work with FTP Client on Explicit Method.
__________________
TandelK is offline
dordnung
Veteran Member
Join Date: Apr 2010
Old 08-23-2020 , 18:33   Re: [EXTENSION] System2 - Easy to use HTTP(S)/FTP Request API and useful system nativ
Reply With Quote #113

Update to System2 v3.3.0

- Fixes crashing on Sourcemod 11 caused by threads
- Updated to libcurl 7.72.0
__________________

Last edited by dordnung; 08-23-2020 at 18:33.
dordnung is offline
CarOL
New Member
Join Date: Oct 2020
Old 02-09-2021 , 01:07   Re: [EXTENSION] System2 - Easy to use HTTP(S)/FTP Request API and useful system nativ
Reply With Quote #114

I got a error on os:Windows when use httprequest

the var: success in httprequest callback was always False
and the error message is "schannel: next InitializeSecurityContext failed: Unknown error (0x80092013)"

do someone known how can i fix this problem?
CarOL is offline
paviln1
New Member
Join Date: Feb 2021
Old 02-12-2021 , 07:50   Re: [EXTENSION] System2 - Easy to use HTTP(S)/FTP Request API and useful system nativ
Reply With Quote #115

Hello.

First of all nice project! I was hoping u could help me out with a problem i am facing.

I am having difficulties making a http request, with a api key in the header.

What i tried so far:

public int GetPlayerId() {
System2HTTPRequest httpRequest = new System2HTTPRequest(HttpResponseCallback, "url");
httpRequest.SetHeader("Content-Type", "application/json");
httpRequest.SetHeader("X-API-Key", "1234");
}

public void HttpResponseCallback(bool success, const char[] error, System2HTTPRequest request, System2HTTPResponse response, HTTPRequestMethod method) {
if (success) {
char[] content = new char[response.ContentLength + 1];
response.GetContent(content, response.ContentLength + 1);

PrintToServer("Content of the response: %s", content);
}
}

The response gives authentication failed. Could u maybe give an example how to do it?
paviln1 is offline
ESL_Ikarus
Junior Member
Join Date: Oct 2017
Old 02-17-2021 , 07:58   Re: [EXTENSION] System2 - Easy to use HTTP(S)/FTP Request API and useful system nativ
Reply With Quote #116

[SM] Unable to load extension "system2.ext": bin/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /serverfiles/cstrike/addons/sourcemod/extensions/system2.ext.so)

anyone a solution for that error?
ESL_Ikarus is offline
richlen99
Junior Member
Join Date: Sep 2014
Old 03-04-2021 , 22:15   Re: [EXTENSION] System2 - Easy to use HTTP(S)/FTP Request API and useful system nativ
Reply With Quote #117

Quote:
Originally Posted by ESL_Ikarus View Post
[SM] Unable to load extension "system2.ext": bin/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /serverfiles/cstrike/addons/sourcemod/extensions/system2.ext.so)

anyone a solution for that error?
im also experiencing this, cstrike on ubuntu 20.04.2 LTS
richlen99 is offline
dordnung
Veteran Member
Join Date: Apr 2010
Old 04-05-2021 , 10:50   Re: [EXTENSION] System2 - Easy to use HTTP(S)/FTP Request API and useful system nativ
Reply With Quote #118

Update to System2 v3.3.1

- Use Debian Strech for compiling as LTS support for jessie ended
- Update OpenSSL to version 1.1.1k and libcurl to 7.76.0
- Fix out-of-memory bug when downloading large files by disable saving of output content when downloading a file
- Add errno message if PosixOpen (command execution) fails
- Disable certificate revocation checks to fix Schannel error
__________________
dordnung is offline
dordnung
Veteran Member
Join Date: Apr 2010
Old 04-05-2021 , 11:01   Re: [EXTENSION] System2 - Easy to use HTTP(S)/FTP Request API and useful system nativ
Reply With Quote #119

Quote:
Originally Posted by SpirT View Post
I have a php request like https://domain.com/index.php?content=somethinghere.
Then, the page will be blank with a simple number: 0 or 1.

I just didn't understand how to use this extension to get the body content and store it in a string...
For example like this:
PHP Code:
#include <sourcemod>
#include <system2>

public void OnPluginStart() {
    
System2HTTPRequest httpRequest = new System2HTTPRequest(HttpResponseCallback"https://domain.com/index.php?content=somethinghere");
    
httpRequest.GET();
    
delete httpRequest;
}

void HttpResponseCallback(bool success, const char[] errorSystem2HTTPRequest requestSystem2HTTPResponse responseHTTPRequestMethod method) {
    if (!
success) {
        
PrintToServer("Error on request: %s"error);
        return;
    }
    
    if (
response.StatusCode != 200) {
        
PrintToServer("Error: Found invalid status code %d"response.StatusCode);
        return;
    }
    
    
char content[10];
    
response.GetContent(contentsizeof(content));
   
    if (
StrEqual("0"content)) {
        
PrintToServer("Content is 0");
    } else if (
StrEqual("1"content)) {
        
PrintToServer("Content is 1");
    } else {
        
PrintToServer("Error: Found invalid content %s"content);
    }

Quote:
Originally Posted by CarOL View Post
the var: success in httprequest callback was always False
and the error message is "schannel: next InitializeSecurityContext failed: Unknown error (0x80092013)"
Should be fixed with 3.3.1

Quote:
Originally Posted by paviln1 View Post
PHP Code:
public int GetPlayerId() {
    
System2HTTPRequest httpRequest = new System2HTTPRequest(HttpResponseCallback"url");
    
httpRequest.SetHeader("Content-Type""application/json"); 
    
httpRequest.SetHeader("X-API-Key""1234");
}

public 
void HttpResponseCallback(bool success, const char[] errorSystem2HTTPRequest requestSystem2HTTPResponse responseHTTPRequestMethod method) {
    if (
success) {
        
char[] content = new char[response.ContentLength 1];
        
response.GetContent(contentresponse.ContentLength 1);

        
PrintToServer("Content of the response: %s"content);
    }

The response gives authentication failed. Could u maybe give an example how to do it?
I need a bit more information about your system to give you an answer here. You never send the request?

Quote:
Originally Posted by ESL_Ikarus View Post
[SM] Unable to load extension "system2.ext": bin/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /serverfiles/cstrike/addons/sourcemod/extensions/system2.ext.so)
Can you retry it with the newest version?
__________________

Last edited by dordnung; 04-05-2021 at 11:02.
dordnung is offline
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 04-06-2021 , 20:43   Re: [EXTENSION] System2 - Easy to use HTTP(S)/FTP Request API and useful system nativ
Reply With Quote #120

Quote:
Originally Posted by dordnung View Post
- Disable certificate revocation checks to fix Schannel error
There is never any good reason for weakening the security for *ALL* people using System2 at once, to fix the issues from one single user, or users of networks where the network admins might eventually be retarded wave pools.

I suggest reverting this, and finding another (potential) "fix", where it won't hurt the security of the users that actually are sitting at nice networks.

Certificate related things should NEVER be disabled by default, and never for all at once, to mitigate such issues.


-> curl/curl/issues/3727#issuecomment-484480726 might provide a potential solution.

Although I would still say it should require manual intervention (like you have done with other things here), in order for the security to be "weakened", if that kind of stuff is really an option you want to support.
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread].
DarkDeviL is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:44.


Powered by vBulletin®
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Theme made by Freecode