installProfile command - Failed to parse profile data (signed profile)

Hi,

My MDM signing certificate is expired and I want to replace the already installed MDM profile("Not Verified") with updated ones.

I look at MDM-Protocol-Reference.pdf and used installProfile command for it. ("The profile may also be signed")


built installProfile request using: https://developer.apple.com/documentation/devicemanagement/install_a_profile

it works for unsigned profile (base64 encode unsigned profile).

but it didn't work for signed profile (base64 encode signed profile), received error status from the device.

and I'm able to install the new signed profile manually (using user interaction) on top of an existing profile.



Device error log:

Failed to parse profile data. Error: NSError:
Desc   : Invalid Profile
US Desc: Invalid Profile
Domain : MCProfileErrorDomain
Code   : 1000
Type   : MCFatalError

I'm Hoping to find a solution for the error OR other way to update the "Not Verified" profile without user interaction.
Device full log:

default    10:07:00.034059 +0300    mdmd    TIC Enabling TLS [1:0x105015240]
default    10:07:00.034108 +0300    mdmd    TIC Enabling TLS [1:0x105015240]
default    10:07:00.034868 +0300    mdmd    TIC TCP Conn Start [1:0x105015240]
default    10:07:00.034910 +0300    mdmd    TIC TCP Conn Start [1:0x105015240]
default    10:07:00.036285 +0300    mdmd    Task <83EBAB60-06B5-42EE-982A-43FA43E59CB9>.<1> setting up Connection 1
default    10:07:00.036327 +0300    mdmd    Task <83EBAB60-06B5-42EE-982A-43FA43E59CB9>.<1> setting up Connection 1
default    10:07:00.036508 +0300    mdmd    [1 <private> <private>] start
default    10:07:00.036464 +0300    mdmd    [1 <private> <private>] start
default    10:07:00.070280 +0300    mdmd    TIC TLS Event [1:0x105015240]: 11, Pending(0)
default    10:07:00.070323 +0300    mdmd    TIC TLS Event [1:0x105015240]: 11, Pending(0)
default    10:07:00.175928 +0300    mdmd    TIC TLS Trust Result [1:0x105015240]: 0
default    10:07:00.175979 +0300    mdmd    TIC TLS Trust Result [1:0x105015240]: 0
default    10:07:00.178796 +0300    mdmd    TIC TLS Event [1:0x105015240]: 13, Pending(0)
default    10:07:00.178839 +0300    mdmd    TIC TLS Event [1:0x105015240]: 13, Pending(0)
default    10:07:00.195485 +0300    mdmd    TIC TLS Event [1:0x105015240]: 20, Pending(0)
default    10:07:00.195528 +0300    mdmd    TIC TLS Event [1:0x105015240]: 20, Pending(0)
default    10:07:00.197112 +0300    mdmd    TIC TCP Conn Connected [1:0x105015240]: Err(16)
default    10:07:00.197166 +0300    mdmd    TIC TCP Conn Connected [1:0x105015240]: Err(16)
default    10:07:00.197650 +0300    mdmd    TIC TCP Conn Event [1:0x105015240]: 1
default    10:07:00.197693 +0300    mdmd    TIC TCP Conn Event [1:0x105015240]: 1
default    10:07:00.197782 +0300    mdmd    TIC TCP Conn Event [1:0x105015240]: 8
default    10:07:00.197739 +0300    mdmd    TIC TCP Conn Event [1:0x105015240]: 8
default    10:07:00.197829 +0300    mdmd    TIC TLS Handshake Complete [1:0x105015240]
default    10:07:00.197871 +0300    mdmd    TIC TLS Handshake Complete [1:0x105015240]
default    10:07:00.203814 +0300    mdmd    Task <83EBAB60-06B5-42EE-982A-43FA43E59CB9>.<1> now using Connection 1
default    10:07:00.203857 +0300    mdmd    Task <83EBAB60-06B5-42EE-982A-43FA43E59CB9>.<1> now using Connection 1
default    10:07:00.204394 +0300    mdmd    Task <83EBAB60-06B5-42EE-982A-43FA43E59CB9>.<1> sent request, body S
default    10:07:00.204453 +0300    mdmd    Task <83EBAB60-06B5-42EE-982A-43FA43E59CB9>.<1> sent request, body S
default    10:07:18.530406 +0300    mdmd    Task <83EBAB60-06B5-42EE-982A-43FA43E59CB9>.<1> received response, status 200 content U
default    10:07:18.530224 +0300    mdmd    Task <83EBAB60-06B5-42EE-982A-43FA43E59CB9>.<1> received response, status 200 content U
default    10:07:18.532521 +0300    mdmd    Task <83EBAB60-06B5-42EE-982A-43FA43E59CB9>.<1> response ended
default    10:07:18.532248 +0300    mdmd    Task <83EBAB60-06B5-42EE-982A-43FA43E59CB9>.<1> response ended
default    10:07:18.534869 +0300    mdmd    Transaction completed. Status: 200
default    10:07:18.535022 +0300    mdmd    Transaction completed. Status: 200
default    10:07:18.535773 +0300    mdmd    Starting power assertion: Request: (null)
default    10:07:18.535584 +0300    mdmd    Starting power assertion: Request: (null)
default    10:07:18.540990 +0300    mdmd    Attempting to perform MDM request: InstallProfile
default    10:07:18.541106 +0300    mdmd    Attempting to perform MDM request: InstallProfile
default    10:07:18.572015 +0300    mdmd    Loaded AccessibilityUtilities.framework
default    10:07:18.572117 +0300    mdmd    Loaded AccessibilityUtilities.framework
default    10:07:18.583088 +0300    mdmd    Loaded SetupAssistant.framework
default    10:07:18.583158 +0300    mdmd    Loaded SetupAssistant.framework
default    10:07:18.585012 +0300    mdmd    Loaded AssertionServices.framework
default    10:07:18.585143 +0300    mdmd    Loaded AssertionServices.framework
default    10:07:18.585359 +0300    mdmd    Loaded AssertionServices.framework
default    10:07:18.585427 +0300    mdmd    Loaded AssertionServices.framework
default    10:07:18.588152 +0300    mdmd    BKSApplicationStateMonitor 0x10510f970 dealloced without invalidate
default    10:07:18.588061 +0300    mdmd    BKSApplicationStateMonitor 0x10510f970 dealloced without invalidate
default    10:07:18.588565 +0300    mdmd    -[FMDFMIPManager isManagedLostModeActive]
default    10:07:18.588633 +0300    mdmd    -[FMDFMIPManager isManagedLostModeActive]
default    10:07:18.599702 +0300    mdmd    Failed to parse profile data. Error: NSError:
Desc   : Invalid Profile
US Desc: Invalid Profile
Domain : MCProfileErrorDomain
Code   : 1000
Type   : MCFatalErrordefault    10:07:18.599793 +0300    mdmd    Failed to parse profile data. Error: NSError:
Desc   : Invalid Profile
US Desc: Invalid Profile
Domain : MCProfileErrorDomain
Code   : 1000
Type   : MCFatalErrordefault    10:07:18.599872 +0300    mdmd    Command Status: Error
Error: NSError:
Desc   : Invalid Profile
US Desc: Invalid Profile
Domain : MCProfileErrorDomain
Code   : 1000
Type   : MCFatalError
default    10:07:18.599924 +0300    mdmd    Command Status: Error
Error: NSError:
Desc   : Invalid Profile
US Desc: Invalid Profile
Domain : MCProfileErrorDomain
Code   : 1000
Type   : MCFatalError
default    10:07:18.599994 +0300    mdmd    MCJQ 1 Enqueueing jobBlock 4, calling function -[MCMDMServer schedulePollingServerForCommandWithAssertion:]
default    10:07:18.600042 +0300    mdmd    MCJQ 1 Enqueueing jobBlock 4, calling function -[MCMDMServer schedulePollingServerForCommandWithAssertion:]
default    10:07:18.600115 +0300    mdmd    MCJQ 1 Job finished, calling function -[MCMDMServer connection:didReceiveMessageForTopic:userInfo:]_block_invoke_2
default    10:07:18.600185 +0300    mdmd    MCJQ 1 Job finished, calling function -[MCMDMServer connection:didReceiveMessageForTopic:userInfo:]_block_invoke_2
default    10:07:18.600263 +0300    mdmd    Ending power assertion: Request: (null)
default    10:07:18.600322 +0300    mdmd    Ending power assertion: Request: (null)
default    10:07:18.600381 +0300    mdmd    MCJQ 1 Dispatching to executionQueue jobBlock 4
default    10:07:18.600453 +0300    mdmd    MCJQ 1 Dispatching to executionQueue jobBlock 4
default    10:07:18.600817 +0300    mdmd    MCJQ 1 Executing jobBlock 4
default    10:07:18.600880 +0300    mdmd    MCJQ 1 Executing jobBlock 4

does anyone getting solution for this i had tried multiple things but still getting the same issues as posted above

installProfile command - Failed to parse profile data (signed profile)
 
 
Q