Skip to content

Commit 5fae68b

Browse files
authored
Merge pull request #80 from plesk/CPCLOUD-4360-no-agent-360-token-ini-created-during-installing-on-windows-server
[CPCLOUD-4360] No agent360-token.ini created during installing on Windows server
2 parents 8d88464 + 0998e91 commit 5fae68b

File tree

2 files changed

+7
-19
lines changed

2 files changed

+7
-19
lines changed

agent360/agent360.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454

5555
__version__ = '1.3.2'
5656
__FILEABSDIRNAME__ = os.path.dirname(os.path.abspath(__file__))
57+
sslContext = ssl.create_default_context(cafile=certifi.where())
5758

5859
ini_files = (
5960
os.path.join('/etc', 'agent360.ini'),
@@ -141,8 +142,9 @@ def hello(proto='https'):
141142
'unique_id': unique_id,
142143
'tags': tags,
143144
'domains': domains,
144-
}).encode("utf-8")
145-
).read().decode()
145+
}).encode("utf-8"),
146+
context=sslContext
147+
).read().decode()
146148

147149
if len(server_id) == 24:
148150
print('Got server_id: %s' % server_id)
@@ -574,12 +576,10 @@ def _data(self):
574576
else:
575577

576578
try:
577-
ctx = ssl.create_default_context(cafile=certifi.where())
578-
579579
if sys.version_info >= (3,):
580-
connection = http.client.HTTPSConnection(api_host, context=ctx, timeout=15)
580+
connection = http.client.HTTPSConnection(api_host, context=sslContext, timeout=15)
581581
else:
582-
connection = httplib.HTTPSConnection(api_host, context=ctx, timeout=15)
582+
connection = httplib.HTTPSConnection(api_host, context=sslContext, timeout=15)
583583

584584
# Trying to send cached collections if any
585585
if cached_collections:

windows/setup.iss

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ SolidCompression=yes
2323
WizardStyle=modern
2424
OutputDir=dist
2525
DisableWelcomePage=no
26-
ArchitecturesInstallIn64BitMode=x64
26+
ArchitecturesInstallIn64BitMode=x64os
2727
UsedUserAreasWarning=no
2828
SetupLogging=yes
2929

@@ -140,18 +140,6 @@ begin
140140
end;
141141
end;
142142
143-
procedure OpenBrowser(Url: string);
144-
var
145-
ErrorCode: Integer;
146-
begin
147-
ShellExec('open', Url, '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
148-
end;
149-
150-
procedure LinkClick(Sender: TObject);
151-
begin
152-
OpenBrowser('https://www.example.com/');
153-
end;
154-
155143
procedure AddCustomQueryPage();
156144
var
157145
RichView: TRichEditViewer;

0 commit comments

Comments
 (0)