Those two wires are the turnsignal element and the running light element. As noted, these turn signals ground to the chassis from the base of the socket to the turnsignal stalk, then to the mounting post that the turnsignal bolts to, then from a bare metal spade inside the headlight shell to the wiring harness green wire. Grab a multimeter, some fine sand paper and maybe a small tube of silicone dielectric grease (aka bulb grease) and take it apart.
Starting at the turnsignal, make certain the bulb socket is connected to the turnsignal base by checking continuity from anywhere on the chrome stalk to the metal bulb base. If the meter goes "beep", move on. If not, find out where the break or corrosion is and fix it.
Next look at the interior of the turnsignal where is slips over the stem. The ground will most easily occur where the bolt contacts both the turnsignal itself and the stem it slips onto. Use the sandpaper to clean those surfaces till you have bright metal on all. Clean off your sanding spooge, smear lightly with the dielectric grease, reassemble.Check for continuity from the bolt head to the turnsignal bulb base again. If your meter goes "beep" move on. If not, do that all again till it does.
Now, inside the headlight bucket where the base of the turnsignal stem resides there will be a metal spade welded to the base of the stem, which should have a green wire from the wiring harness slid into it. Remove the green wire, and scuff that spade with the sandpaper till its bright. Clean it and dielectric grease it (a little is enough). Clean the green wire connector as best you can and ensure its a snug fit onto the spade. If it's loose, carefully squeeze the curled part with fine pliers till it's a snug fit. Now check continuity from this spade to the turnsignal base (bolt head is fine). If the meter goes beep, you're good. Reconnect the spade to the green wiring harness lead. That will probably fix it.
If it's STILL flaky, remove the green ground ring terminal under the seat from above the battery, clean and grease it and where it mounts, and reinstall. That's your primary wiring harness-to-chassis ground point. But I doubt this is the issue because the rest of the stuff is working fine.
Ride on.
:-).