Skip to content

Error with export openvpn config #808

@pieterjanhaan

Description

@pieterjanhaan

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

curl -X 'POST'
'https://vpn2.lexact.nl/api/v2/vpn/openvpn/client_export'
-H 'accept: application/json'
-H 'x-api-key: '
-H 'Content-Type: application/json'
-d '{
"id": 0,
"type": "confzip",
"certref": "6952a23bc8eea",
"username": "LexactV3",
"server": 1,
"useaddr": "serveraddr",
"useaddr_hostname": "",
"verifyservercn": "auto",
"blockoutsidedns": false,
"legacy": true,
"silent": false,
"bindmode": "nobind",
"usepkcs11": false,
"pkcs11providers": [],
"pkcs11id": "null",
"usetoken": false,
"usepass": false,
"pass": "",
"p12encryption": "high",
"useproxy": false,
"useproxytype": "http",
"proxyaddr": "",
"proxyport": "",
"useproxypass": "none",
"proxyuser": "",
"proxypass": "",
"advancedoptions": ""
}'

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
To export VPN config

Screenshots or Response
{
"code": 500,
"status": "internal server error",
"response_id": "ENDPOINT_RECEIVED_UNEXPECTED_ERROR",
"message": "in_array(): Argument #2 ($haystack) must be of type array, null given\n#0 /usr/local/pkg/RESTAPI/ModelTraits/OpenVPNClientExportTraits.inc(197): in_array()\n#1 /usr/local/pkg/RESTAPI/Core/Model.inc(1427): RESTAPI\Models\OpenVPNClientExport->validate_legacy()\n#2 /usr/local/pkg/RESTAPI/Core/Model.inc(2067): RESTAPI\Core\Model->validate()\n#3 /usr/local/pkg/RESTAPI/Core/Endpoint.inc(1165): RESTAPI\Core\Model->create()\n#4 /usr/local/pkg/RESTAPI/Core/Endpoint.inc(1071): RESTAPI\Core\Endpoint->post()\n#5 /usr/local/www/api/v2/vpn/openvpn/client_export/index.php(9): RESTAPI\Core\Endpoint->process_request()\n#6 {main}",
"data": []
}

pfSense Version & Package Version:

  • pfSense Version: 25.11
  • Package Version v2.6.8

Affected Endpoints:

  • URL: api/v2/vpn/openvpn/client_export

Metadata

Metadata

Assignees

No one assigned

    Labels

    25.11Issues and PRs pertaining to pfSense Plus 25.11bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions