Let Ω ⊈ ℝn+1 be open and let μ be some measure supported on ∂Ω such that μ.B(x, r)) ≤ C rn for all x ∊ Rn+1, r > 0. We show that if the harmonic measure in Ω satisfies some scale invariant A1-type conditions with respect to μ, then the n-dimensional Riesz transform (equcation presented) is bounded in L2(μ). We do not assume any doubling condition on μ. We also consider the particular case when Ω is a bounded uniform domain. To this end, we need first to obtain sharp estimates that relate the harmonic measure and the Green function in this type of domains, which generalize classical results by Jerison and Kenig for the well-known class of NTA domains.