The King's Pirate (1967)
Movie
Released
This later take on Against All Flags sends a naval officer into a pirate group under cover. It offers another way to stage the same uncomfortable bargain, with the captain needing help from people who would have a reason to turn on him if they understood his mission.
More about The King's Pirate