I think you can use a "gender changer"
Googling, it looks like you can get ones with a female screw(nut) both sides, but even if you can't, from memory, there is enough depth on the thread to fit a long nut which does the same job as the normal one, but doesn't have the male thread extension.
If you can't get the long nut, you can cut off the male thread extension on the usual type, trying not to mangle the thread on the other part.
Some years back, I was involved with various kinds of butchery of "D" connectors, & remember you could buy odd sorts of special nuts, apart from the conventionsl ones.
On second thoughts, I think that some versions of "D"connectors can use long female screws,with knurled tops like the normal male ones.
I guess the holes in the metal part of the plug need to be a bit larger to do this.