Proxmox changes secure transport protocol

wupeng

New Member
Mar 4, 2024
4
0
1
I have successfully installed Proxmox now, and I have a requirement. I would like to change the default HTTPS to HTTP. How can I modify it? I think it should be a configuration file, but I couldn't find it. My Proxmox version is 8.0.3. Please help me solve this problem
 
Hey,

you can't. Why would you need to in the first place? What's your use-case?
 
Hey,

you can't. Why would you need to in the first place? What's your use-case?
Not closing it is not a problem, but when I access it through Chrome, a page will pop up, reminding me that your connection is not a private connection and that the link is an unsafe page. How can I close it
 
Those warnings usually pop up only the first time, browsers usually remember that you trust it. What could do is get a certificate from Let's encrypt, you can set that up in the Web UI just select the plugin for the DNS provider you are using, and PVE does the DNS challenge automatically[1]. Assuming you have a domain name, without one you also can't get a trusted certificate for one. As an alternative you could tell your browser to trust the CA PVE used for signing the certificate, for that you can follow[2].


[1] https://pve.proxmox.com/wiki/Certificate_Management
[2] https://pve.proxmox.com/wiki/Import_certificate_in_browser
 
Those warnings usually pop up only the first time, browsers usually remember that you trust it. What could do is get a certificate from Let's encrypt, you can set that up in the Web UI just select the plugin for the DNS provider you are using, and PVE does the DNS challenge automatically[1]. Assuming you have a domain name, without one you also can't get a trusted certificate for one. As an alternative you could tell your browser to trust the CA PVE used for signing the certificate, for that you can follow[2].


[1] https://pve.proxmox.com/wiki/Certificate_Management
[2] https://pve.proxmox.com/wiki/Import_certificate_in_browser
Thank you very much, but I have found that my substantive issue has not been resolved. I need to reorganize my requirements. I actually want to write a script and control Proxmox to batch shut down or start certain virtual machines. But I encountered a new problem first, which is that I kept reporting 401 permission issues during the request. Can you help me take a look at this problem? My specific Python code is as follows:




import requests
# Proxmox VE 主机的相关信息
proxmox_host = "192.138.4.200"
proxmox_user = "root@pam"
proxmox_password = "iecas1222"
proxmox_node = "iecas"
# 获取 Proxmox 登录票据
def get_ticket():
login_url = f"https://{proxmox_host}:8006/api2/json/access/ticket"
login_data = {
'username': proxmox_user,
'password': proxmox_password,
}
response = requests.post(login_url, data=login_data, verify=False)
ticket_data = response.json()
result=ticket_data.get('data', {}).get('ticket')
return result
# 关机虚拟机
def shutdown_vm(vmid):
ticket = get_ticket()
if ticket:
shutdown_url = f"https://{proxmox_host}:8006/api2/json/nodes/{proxmox_node}/qemu/{vmid}/status/shutdown"
headers = {'CSRFPreventionToken': ticket}
response = requests.post(shutdown_url, headers=headers, verify=False)
print(response)
if response.status_code == 200:
print(f"虚拟机 {vmid} 已关机")
else:
print(f"无法关机虚拟机 {vmid}")

# 批量关机虚拟机
def batch_shutdown_vms(vm_list):
for vmid in vm_list:
shutdown_vm(vmid)
# 虚拟机ID列表
vm_ids_to_shutdown = [109] # 你的虚拟机ID列表
# 执行批量关机
batch_shutdown_vms(vm_ids_to_shutdown)
 
Last edited:
Hey,

I think what you are looking for is the startall[1] and stopall[2] endpoints in our API. These are exactly for starting or shutting down VMs in bulk, they take a list of VMIDs and then start or stop all of them. You can also pass parameters for a timeout or force-shutdown. To learn how to interact with the API, get authenticated using it etc. you can take a look at [3].

[1] https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/startall
[2] https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/stopall
[3] https://pve.proxmox.com/wiki/Proxmox_VE_API
 
Hey,

I think what you are looking for is the startall[1] and stopall[2] endpoints in our API. These are exactly for starting or shutting down VMs in bulk, they take a list of VMIDs and then start or stop all of them. You can also pass parameters for a timeout or force-shutdown. To learn how to interact with the API, get authenticated using it etc. you can take a look at [3].

[1] https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/startall
[2] https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/stopall
[3] https://pve.proxmox.com/wiki/Proxmox_VE_API
Thank you very much, my problem has been resolved. It turns out that not only tokens need to be passed, but also cookies need to be passed. You have been very helpful to me. Wishing you a happy new year and good health.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!