There is the invariant Maurer–Cartan 1-form on a compact semi-simple Lie group G. So if we pull it back using a map from X to G then we get a G-connection on X. The question is, can all G-connections on X ( here just regarded as elements in {\Omega}^1(X, \mathfrak{g}), i.e. we are using the trivial G-bundle over X ) arise in this way?

For flat connections, I believe the answer is yes, which can be seen when one "cut" the Riemann surface into a disc with boundary conditions. But I have no idea about the general case.

Some facts that may be useful ( when I tried to figure out an answer ) :

1. It is well-known that all G-connections on X can arise from a map from X to BG by pulling back a special connection on BG.

2. If {\pi}_1(G) = {\pi}_2(G) = 0, then I guess there shall be no homotopic non-trivial map from X  to G  ( note {\pi}_n(X) = 0 when n > 2 ), and hence all maps from X to G are "integrable" in the sense that they can be induced by applying the exponential map on maps from X to \mathfrak{g}. Not sure about how this will help though.

3. Actually I am not even sure about the G = U(1) case. On the other hand, if the answer is true, then probably the curvature of the induced connection will have some topological constraints coming from the map {\pi}_1(X) \rightarrow \mathbb{\pi}_1(G). 

I haven't touch math for quite some time due to personal reasons, so I hope I am not making any trivial mistakes in this post ;-)